javascript move in array automatically code example
Example: moving a item fro index to another index, javascript
function arraymove(arr, fromIndex, toIndex) {
var element = arr[fromIndex];
arr.splice(fromIndex, 1);
arr.splice(toIndex, 0, element);
}