let's say I call use this syntax in es6:
let a, b;
{a, b} = { a: 100, b: 300 };
the code will run without error;
but let's rewrite is like this:
function fn() {
return { a: 100, b: 200 }
}
let a, b;
{ a, b } = fn();
when I run the code above, it says unexpected token "="; I am a little confused, what is the difference?