The following valid ES6 in WebStorm:
let {a,b} = {a:0,b:0};
{a,b} = {a:2,b:4};
shows an error at the second equals sign: "expression expected". Obviously JavaScript settings are set to ES6.
By the way adding parentheses removes the error:
let {a,b} = {a:0,b:0};
({a,b} = {a:2,b:4});
Is this a bug or part of the ES6? The node compiler seems to have no problem with the first version (without the parentheses), so it doesn't seem to be part of the standard.
let {a,b}= {a:0,b:0}or the second version.let, since theaandbvariables will be global. Not evenvar. Just global variables.function x() { ({a,b} = {a:2,b:4}); }. After calling this function you will be able to access these variables in global scope. If it would beconst,letor evenvar, you wouldn't have access to it outside function.