To add to what Richard has said,
this
always refers to the current instance of the class it is used in: it allows you to be specific as with which of several variables of the same name you intended to use. For example if you have a method with a parameter called
foo
and a class level variable also called
foo
, then inside the method the parameter takes precedence and you need
this.foo
to access the class level variable.
See here:
JavaScript this[
^]