Destructuring object outside of var declaration

Claude Pache claude.pache at gmail.com
Tue Nov 15 18:57:39 UTC 2016



> Le 14 nov. 2016 à 22:53, Boris Zbarsky <bzbarsky at mit.edu> a écrit :
> 
>> On 11/13/16 1:28 PM, Thaddee Tyl wrote:
>>    var foo, bar;
>>    {foo, bar} = {foo: 2, bar: 3};
>> 
>> is a "SyntaxError: expected expression, got '='" in Firefox, and *it
>> works in Google Chrome*.
> 
> I get "Uncaught SyntaxError: Unexpected token =" in Chrome "56.0.2914.3 dev" and in Chrome "54.0.2840.9" (release).
> 
> -Boris

My guess is that Thaddee Tyl was confused by a Chrome DevTools feature, as in:

https://esdiscuss.org/topic/incosistency#content-6

—Claude


More information about the es-discuss mailing list