155 B
155 B
Swap values of two variables
Use array destructuring to swap values between two variables.
[varA, varB] = [varB, varA];
// [x, y] = [y, x]
Use array destructuring to swap values between two variables.
[varA, varB] = [varB, varA];
// [x, y] = [y, x]