var el1,el2 = [1,2] why not?

Rick Waldron waldron.rick at gmail.com
Wed Jul 4 13:00:09 PDT 2012


On Wed, Jul 4, 2012 at 10:31 AM, Hemanth H.M <hemanth.hm at gmail.com> wrote:

> var a,b = 1; sets b to 1 and a is undefined, this is more C
> like semantics.
>
> Where as a,b = b,a is more pythonis; Well then a,b=[1,2] should
> make sense ?
>
> /me also agrees to var[a,b] = foo;
>

It might be helpful to read through the currently harmonized proposal for
destructured assignments:

http://wiki.ecmascript.org/doku.php?id=harmony:destructuring

Rick



>
> snip
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120704/5716ca8c/attachment.html>


More information about the es-discuss mailing list