🚧 under construction
JS ⟩ objects ⟩ arrow function ⟩ as class field
the body of a class has a this context.
arrow function as class field closes over the class's this context.
the this inside the arrow function's body:
will correctly point to the instance (or the class itself, for static fieldsarrow-up-right).
it is a closure, not the function's own binding, the value of this will not change based on the execution context (call site)❗
👉 MDN ⟩ arrow functions used as methodsarrow-up-right ⭐️
arrow function as method❗️.
class field
arrow functions used as methodsarrow-up-right ⭐️
Public class fieldsarrow-up-right
Last updated 3 years ago