An array destructing specification choice

Axel Rauschmayer axel at rauschma.de
Sun Nov 6 06:32:14 PST 2011


One more thought: Should the following assignments produce the same result?

     [x, y, z] = {length:0, 0:0, 1:1, 2:2}
     [x, y, z] = [].slice.call({length:2, 0:0, 1:1, 2:2})

Then the decision boils down to whether an array conversion happens (however implicitly) on the rhs or whether the lhs is syntactic sugar for
     x = rhs[0], y = rhs[1], z = rhs[2]

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



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


More information about the es-discuss mailing list