Troque duas variáveis JavaScript
var a = 1,
b = 2;
b = [a, a = b][0];
Sticky Pingu
var a = 1,
b = 2;
b = [a, a = b][0];
var a = 5;
var b = 3;
[a, b] = [b, a];
let x = 2;
let y = 4;
document.write("x = " + x + "<br>" )
document.write("y = " + y)