Maybe ban holes, then... (was: Re: lexical for-in/for-of loose end)

Herby Vojčík herby at
Thu Feb 2 12:21:44 PST 2012

Allen Wirfs-Brock wrote:
> It isn't just possible, it is already specified as valid. and
> youdon't need the quotes around the array indices. But you need a set
> ofparams to deal with the expression statement can't start with {
> problem. This wouldn't be the case for binding position
> destructuring.
> ({5:x} = someArray);
> ({0:a, 2:y} = someArray);

A bit off-topic... I don't like paretheses. Not only because I have to 
put them in both ends, but also because of uncomfortable feeling of 
"thing closed in parentheses".

Maybe alternative convention to deal with expressions beginning with { 
could be used as well:

   0, {5:x} = someArray;
   0, {0:a, 2:y} = someArray;


More information about the es-discuss mailing list