JavaScript clicker game
In the third line, there's a let self = this;. I did that because I needed to access the Cat instance inside the img.click callback function.


Use an arrow function, which won't rebind this. The self alias can then be removed.

this.img.click = () =&gt; {
  this.count++;
  ...
}


Your examples don't save the Cats anywhere, access any properties on them, pet them, or otherwise interact with them -- if adding a cat to the DOM is all you need, the constructor doesn't need to attach anything to this (which is equivalent to exposing things as public properties).


  The Cat constructor adds a new cat in the HTML (it appends the cats div), using div, h1, img and p.


Putting that behaviour in the constructor is not ideal. People reading your code probably expect new Cat(...) to return a cat, but not necessarily for it to put that cat somewhere. Besides being unexpected, this isn't very flexible: what if I want to put a cat somewhere else on the page?

It's probably better to separate creating the cat (and its click handler) from actually attaching it anywhere. You could add another method in the Cat class, like this:

  attach(element) {
    element.append(this.catDiv);
  }


but I think all you need in this example is a function:

function createCat(name, picture) {
  let clickCount = 0;

  const $cat = $('&lt;div/&gt;');    // $var is just a naming convention for jQuery variables
  const $img = $('&lt;img/&gt;', { src: picture }).appendTo($cat);
  const $counter = $('&lt;p/&gt;').appendTo($cat);

  $img.click(() =&gt; {
    clickCount++;
    $counter
      .text(`You clicked ${name} ${clickCount} times.`)
      .css("font-size", "+=0.5");    // Most jQuery methods can be chained
  });

  return $cat;    // return the cat div, not yet attached to the DOM
}


$(function() {    // equivalent to $(document).ready(function() {
  const $main = $('#cats');

  $main.append(createCat('Kimmy', 'http://newmediarockstars.com/wp-content/uploads/2014/07/femcat.png'));
  $main.append(createCat('Logan', 'http://svoctopussy.com/wp-content/uploads/2013/02/Grumpy-Cat.jpg'));
});