I am simply using es6 to reassign variables a & b. Why do I get an error if I leave the semicolon off of the a and b declaration and assignment statements? Does the parser try to pull a property out of 2 if the semicolon is left off? let b = 2[a, b]...?
Works:
let a = 1;
let b = 2;
[a, b] = [b, a]
Error:
let a = 1
let b = 2
[a, b] = [b, a]
I am looking for the actual reason this fails. Thanks!