❗arrow function as method❗️
🚧 under construction
JS ⟩ objects ⟩ arrow function ⟩ as method
⭐️ ❗️use with caution❗️
normally, you don't use arrow functions as methods, but if you have:
an object A that has a method returning a new object B,
object B has its own methods, you don't want this in these methods to refer to B, but refer to A instead,
then using arrow function as method is an option.
👉 see example: Sequence
Last updated