Array comprehension syntax

Brendan Eich brendan at mozilla.com
Sun Sep 13 16:05:56 PDT 2009


This sounds like a binary trade: follow Python and other precedent, or  
help autocompletion tools. I don't buy it, but it is hard to argue on  
these terms. Putting the comprehension expression on the right could  
help, but JS is dynamic: do you really know the type of i in more  
interesting cases than [i.toString() for each (i in [1,2,3]))]? That  
is a contrived example.

Real comprehensions are not so easy to analyze for likely  
autocompletions.

Real comprehensions are short enough the saved typing is not huge, in  
my experience.

/be


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20090913/be82bc59/attachment.html>


More information about the es-discuss mailing list