Deconstructing assignment and reader/modify/write operands

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Sep 24 08:42:49 PDT 2013


On Sep 23, 2013, at 12:05 PM, Oliver Hunt wrote:

> I am reading the spec and it looks (to me at least) like we expect [a,b,c] += [1,2,3] to be equivalent to a+=1; b+=2; c+=3 — is that correct or have i misread something?
> 

No, see http://people.mozilla.org/~jorendorff/es6-draft.html#sec-12.13.2 

Destructuring is only  checked for in the  LHS = RHS case.

The LHS AssignmentOperator RHS case is just like ES5 and doesn't do any destructuring.

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


More information about the es-discuss mailing list