📘this
🚧 under construction
Last updated
Was this helpful?
🚧 under construction
Last updated
Was this helpful?
Was this helpful?
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.
does not necessarily refer to the containing the .
is passed (at ) by the function call. 👉 .
s don’t have “own” this, it’s taken from the "outer context" .
the body of a has a this context.
👉 see ⟩ .
if the code you need to wrap a around has , , , or in it, don't use a /(which has its own ), use a instead❗️
📗