Destructuring Example 15

Destructuring arrays - swapping variables

by shravan

Babel + JSX

let x = 10, y = 20;

[x, y] = [y, x];

console.log(x, y); //20 10