ES6 doesn't need opt-in

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Jan 3 17:19:53 PST 2012


On Jan 3, 2012, at 4:58 PM, Brendan Eich wrote:

>> ...
> 
> No, compare to ArrayLiteral:
> 
> ArrayLiteral : // See 11.1.4
>    [ Elisionopt ]
>    [ ElementList ]
>    [ ElementList , Elisionopt ]
> 
> ElementList :  // See 11.1.4
>    Elisionopt AssignmentExpression
>    ElementList , Elisionopt AssignmentExpression
> 
> 
> Replace ArrayLiteral with ArrayBindingPattern, ElementList with BindingElementList, and AssignmentExpression with BindingRestElement.
> 
> 

But note that ES.next ArrayLiterals are different from ArrayBindingPatterns. the ... in ArrayLiteral is the spread operator and can occur multiple times and in any position.  The ... in ArrayBindingPattern is the rest operator and can only occur once at the end of the list.

Allen


> 



More information about the es-discuss mailing list