destructuring: as patterns?

Brendan Eich brendan at mozilla.org
Wed Apr 18 09:29:52 PDT 2012


Herby Vojčík wrote:
> Herby Vojčík wrote:
>>
>> Maybe allowing
>> let {b, b:{x,y}} = obj;
>> would be enough. It sort-of comforms to existing syntax as well as
>> semantics.
>
> BTW, if you use var instead of let, if already works out of the box 
> (in FF11 firebug console; just tried), so why include as if it already 
> is there, albeit in different form? 

We implemented destructuring years ago to implementor- and user-test ES4 
proposals. They did not forbid duplicates. That's all.

Nothing normative in experimental Firefox implementation features, of 
course. You cite them as "already [there]" and that's true but it 
doesn't govern what goes into ES6.

/be


More information about the es-discuss mailing list