Understanding the “this” keyword in Javascript

The this keyword always refers to an object.

We can use it outside of any function in the global scope but most often it is used inside a function (otherwise known as a method, when the function is defined inside an object).

When it is used within a method, it refers to the object on which the method is being invoked.

Continue reading “Understanding the “this” keyword in Javascript”