DEV Community

Discussion on: 'this' and arrow functions

Collapse
 
kayis profile image
K

Yes, the capturing of this by arrow functions is rather cumbersome.

Somehow I managed to use it either in a functional programming context where there is no this needed or with classes and class fields, where I can write something like class A { x = "world!"; m = () => "Hello, " + this.x; }.

Collapse
 
wangonya profile image
Kelvin Wangonya

Nice! Maybe you should do an article on that when you find the time. Expound on it a little more, I'd be interested (or have you already?).

Thanks for reading

Collapse
 
kayis profile image
K

On what specifically?