arrow function syntax simplified

Claus Reinke claus.reinke at
Tue Apr 3 02:01:32 PDT 2012

>> I agree that leading |this| could be important for dynamic 
>> non-method use-cases, but those are relatively rare (let's 
>> not discount JQuery, but again, it could use long functions 
>> and survive). We could put leading-this-parameterization 
>> on the agenda for May, but we'll have to be careful not to 
>> lose consensus on arrows.
> Other than the JQuery style misuse of this, what are the use 
> cases? If you want to bind this, why wouldn't a method 
> invocation on an objet be involved?

The ES array loops accept an optional this parameter to
be used for the loop callback. The new strawman for data
parallelism also passes this to its method callbacks.

Is there anything wrong with my getthis/fn wrappers as
a workaround? We can't use 'this' as parameter name,
and the wrapper adds a pair of parens. Anything else?


More information about the es-discuss mailing list