DEV Community

Discussion on: How can you swap two variables without using a third?

Collapse
 
jochemstoel profile image
Jochem Stoel
let x = 1, y = 2
let [x,y] = [y,x]

One extra reason to love JavaScript.