Nathan Wall (2013-09-17T14:06:14.000Z)
I'm wondering what the best syntax is for object destructuring outside of a var declaration.  For instance, the following works in Firefox Nightly and Traceur:
    var { a, b } = foo;
but the following doesn't:
    var a, b;    { a, b } = foo;
I presume this is because in the second case the { a, b } is a block.
However, the following does work:
    var a, b;    ({ a, b }) = foo;
Is the above what people are expected to use (when they need to use destructuring outside of a var/let declaration or function arguments), or is there another form available?
Thanks,Nathan 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130917/0aaf50e9/attachment.html>
domenic at domenicdenicola.com (2013-09-25T02:38:07.128Z)
I'm wondering what the best syntax is for object destructuring outside of a var declaration.  For instance, the following works in Firefox Nightly and Traceur:

    var { a, b } = foo;

but the following doesn't:

    var a, b;    { a, b } = foo;

I presume this is because in the second case the { a, b } is a block.
However, the following does work:

    var a, b;    ({ a, b }) = foo;

Is the above what people are expected to use (when they need to use destructuring outside of a var/let declaration or function arguments), or is there another form available?