4 ms·
Not really an equivalent, because "this" would be different - unlike with function(){}, there is no automatic this-context binding with arrows, so just switchin
by drdaeman 10y ago
Not really an equivalent, because "this" would be different - unlike with function(){}, there is no automatic this-context binding with arrows, so just switching to a fancier syntax in existing code may break things.
Also, no "arguments" (there are ...rest parameters that allow for variadic functions).
- divbit 10y ago> no automatic this-context binding with arrows, I thought the arrows were now binding to surrounding context? (e.g. https://babeljs.io/blog/2015/06/07/react-on-es6-plus https://babeljs.io/blog/2015/06/07/react-on-es6-plus)
- nicoburns 10y agoIt is equivalent in this case though, as the function body doesn't use any of those features...