Re:Arrow Functions Coming to Chrome 45
by rcfox on Monday June 22, 2015 @03:34PM
(#9760669)
Arrow functions and `let` are what is generally considered to be the "correct" way of doing things. They behave more closely to how other languages behave, and should reduce overall confusion in the long term.
The arrow operator is indeed syntactic sugar for binding `this` to the function. It's not really necessary, but it makes it much easier to do what you expect to do 99% of the time.
Yes, it sucks that there are now two slightly different ways of doing things, but it's better than breaking all of the existing code currently in use. Hopefully, linters and analysis tools will mark `var` and non-arrow functions as deprecated soon after the major engines support ES6.
The arrow operator is indeed syntactic sugar for binding `this` to the function. It's not really necessary, but it makes it much easier to do what you expect to do 99% of the time.
Yes, it sucks that there are now two slightly different ways of doing things, but it's better than breaking all of the existing code currently in use. Hopefully, linters and analysis tools will mark `var` and non-arrow functions as deprecated soon after the major engines support ES6.