๐this
๐ง under construction
JS โฉ execution context โฉ lexical environment โฉ environment record โฉ "this"
Within the body of a method, "this" evaluates to the object on which the method was invoked.
property of an execution context.
the object โbefore dotโ (the one who calls the method).
"this" determined on call siteโ๏ธ (runtime), not by function declaration (compile-time).
but there are exceptions, ๐ see๏ผarrow function arrow function as class fieldโ๏ธ
this
is not fixed in a method.
is passed (at runtime) by the function call. ๐ method binding.
The value of this in a normal function is by default๏ผ
arrow functions donโt have โownโ this, itโs taken from the "outer context" .
the body of a class has a this context.
๐ see arrow function โฉ arrow function as class fieldโ๏ธ.
the value of this is stored in environment record.
Last updated