Why is this not valid when using the new es6 destructuring syntax
var a, b, c;
{a, b, c } = {a:1, b:2, c:3};
when this is:
var {a, b, c } = {a:1, b:2, c:3};
console.log(a, ' ', b, ' ',c);
and so is this:
var a = 1;
var b = 3;
[a, b] = [b, a];
I had a read of the MDN documentataion and I see no mention of the syntax I'm attempting and I assume there must be a good reason, I'm just trying to understand why.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…