Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript move element in array

function arrayMove(arr, fromIndex, toIndex) {
    var element = arr[fromIndex];
    arr.splice(fromIndex, 1);
    arr.splice(toIndex, 0, element);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #move #element #array
ADD COMMENT
Topic
Name
3+7 =