¿Cómo hago el mayor swap JavaScript Stack Overflow
let a = 1;
let b = 2;
[b, a] = [a, b] // a = 2, b = 1
Adorable Alpaca
let a = 1;
let b = 2;
[b, a] = [a, b] // a = 2, b = 1