return when desugaring to closures

Brendan Eich brendan at
Fri Aug 22 07:55:34 PDT 2008

On Aug 22, 2008, at 7:28 AM, Ingvar von Schoultz wrote:

>> Probably not instinct (no survival advantage ;-); possibly lack  
>> of  familiarity with the new form in context. Try using it in  
>> more  realistic code for a few days (especially the shorthand form)
> The shorthand form would be the same (or am I missing something?)

var {a, b, c} = fn();

binds a, b, and c to the same-named properties of the returned object.

>> and  ping me if it still reads like an object initialiser.
> Stockholm syndrome!
> People can get used to anything. Just look at Perl. :-)

True, and apart from duress (which was what I was getting at about  
Stockholm syndrome -- the web was hostage for a long while and no one  
had a choice), people have legitimate differences of opinion on  
what's good. JS is not Perl, but it is also not on the "there must be  
one and only one way to do it" side of the spectrum. It's multi- 
paradigm already.


More information about the Es-discuss mailing list