arrow function syntax simplified

Brendan Eich brendan at mozilla.com
Wed Mar 28 14:10:01 PDT 2012


John J Barton wrote:
> On the other hand, failing to bind 'this' is something that I believe 
> every single JS developer hits routinely. It has cost them time to 
> recognize and recover. The net advantage of a better bind mechanism 
> still depends upon many issues, but this problem has much bigger 
> impact that eight vs two characters.

I agree, so I'm now thinking (as just posted in reply to Kevin) that we 
want -> and => for block and expression bodied short functions, and 
(this ~~~) at the front of the formal parameter list for dynamic |this| 
binding, without which the default is lexical |this|.

/be


More information about the es-discuss mailing list