Files
30-seconds-of-code/snippets/swap-values-of-two-variables.md
Angelos Chalaris 43f8529cb9 Added samples
2017-12-12 17:50:08 +02:00

155 B

Swap values of two variables

Use array destructuring to swap values between two variables.

[varA, varB] = [varB, varA];
// [x, y] = [y, x]