js array swap values code example
Example 1: how to swap two elements in an array js
// Since ES6
[a[0], a[1]] = [a[1], a[0]]
Example 2: js swap
dmitripavlutin.com › swap-variables-javascript
// Since ES6
[a[0], a[1]] = [a[1], a[0]]
dmitripavlutin.com › swap-variables-javascript