5 ms·
Once I started using arrow notations, I stopped worrying about `this`. Whenever I need to export class function, I do var foo = () => bar.baz() , no more
by shp0ngle 10y ago
Once I started using arrow notations, I stopped worrying about `this`.
Whenever I need to export class function, I do
var foo = () => bar.baz()
, no more worrying, no need to understand what the hell bind does exactly.
Also with the ... notation, I stopped worrying about .call and .apply. So I can write
var someArray = [a,b,c]
var foo = () => bar.baz(...someArray)
and so on.