Look at the following pieces of code
let a = 1;
let b = 2;
[a,b] = [b,a]
console.log(a); // logs 2
console.log(b); // logs 1
now the same code with above, but without semicolons in the variable declarations - initializations:
let a = 1
let b = 2
[a,b] = [b,a]
console.log(a);
console.log(b);
Now it throws the error: "Uncaught ReferenceError: Cannot access 'b' before initialization".
Why does this happen?