arrow function as class field❗️

🚧 under construction

JSobjectsarrow 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 fields).

    • 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 methods ⭐️

Last updated