Le 2 oct. 2013 à 09:34, David Bruant <[email protected]> a écrit :

>> 
>> So I actually wonder what kind of JavaScript **you** write because this was 
>> a honest question but probably ... people not familiar with JS are the 
>> answer: since developers ignore part of JS specs available since every then 
>> we need a fat arrow to break old syntax to make the creation of self bound 
>> function easier.
> One of the reason of arrow functions to exist is to get rid of the need for 
> "var self = this" or equivalent ('that', '_this', etc.). Example on MDN:
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/arrow_functions#Lexical_this

+1. The big win of arrow-functions, is that it prevents from using various 
ad-hoc kludges (`var that = this`, `[].some(..., this)`, etc), whose sole goal 
is to defeat some unwanted feature (proper `this` binding in callbacks). Not a 
killing-feature, but a nice addition that will help to reduce noise in code.

—Claude

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to