An array destructing specification choice

Axel Rauschmayer axel at
Sun Nov 6 10:27:00 PST 2011

>> If I wanted to ignore the length property, I would use:
>>     let { 0: a, 1: b } = someValue
> This is pretty much my thinking too.  A programmer's choice to use  [ ]  instead of {} the destructuring pattern means something. By choosing to use [ ] as the pattern they are expressing the intent to view someValue using "array element" access semantics. If they don't care about such things, they can use the { } pattern.

One would have to rethink all of these issues if the namespaces of array indices and of property names became disjoint in the future. But it’s just an edge case, anyway.

Dr. Axel Rauschmayer
axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list