The object that the this
keyword refers to
does not depend on where the method is defined.
It only depends on the object that invokes the
function it is used in.
In the example below,
this
is used inside a function definition.
The function is then assigned to
two different objects.