DEV Community

Discussion on: Terrible interview question: Swap variables without a temporary

Collapse
 
coelhoadler profile image
Adler Coelho Santos

With Javascript it's easy!

let a = 5;
let b = 6;

[a, b] = [b, a]