• this is used inside a function (let’s say function A) and it contains the value of the object that invokes function A.
  • this is not assigned a value until an object invokes the function where this is defined.
  • the object that invokes the this function is in context, and we can change the context by invoking the this function with another object (such as using apply() method); then this new object is in context.
  • If we really want this.data to refer to the data property on the specific object, we can use the Bind (), Apply (), or Call () method to specifically set the value of this.
  • closures cannot access the outer function’s this variable by using the this keyword because the this variable is accessible only by the function itself, not by inner functions.

Understand JavaScript’s “this” With Clarity, and Master It