switch 2 elements in an array javascript code example
Example 1: javascript switch items in array
var b = list[y];
list[y] = list[x];
list[x] = b;
Example 2: javascript swap array elements
var b = list[y];
list[y] = list[x];
list[x] = b;
var b = list[y];
list[y] = list[x];
list[x] = b;
var b = list[y];
list[y] = list[x];
list[x] = b;