Answers for "moving a item fro index to another index, javascript"

2

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);
}
Posted by: Guest on June-07-2020

Code answers related to "moving a item fro index to another index, javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language