how to swap the elements in js code example
Example 1: javascript swap variables
var a = 5;
var b = 3;
[a, b] = [b, a];
Example 2: js swap
dmitripavlutin.com › swap-variables-javascript
var a = 5;
var b = 3;
[a, b] = [b, a];
dmitripavlutin.com › swap-variables-javascript