cf.completefrontend

Predict the outputHard

Why does the second destructuring swap here fail?

What does this log?
let a = 1;
let b = 2;
[a, b] = [b, a];
console.log(a, b);
 
let x = 1
let y = 2
[x, y] = [y, x]
console.log(x, y)

The answer

Work out every line it logs, in order. Then check.

Checking your sign-in…