Returns a new array with the item at fromIndex moved to toIndex.
fromIndex
toIndex
The source array.
Current index of the item to move.
Target index.
moveArrayItem([1, 2, 3, 4], 0, 3) // => [2, 3, 4, 1]moveArrayItem([1, 2, 3, 4], 3, 0) // => [4, 1, 2, 3] Copy
moveArrayItem([1, 2, 3, 4], 0, 3) // => [2, 3, 4, 1]moveArrayItem([1, 2, 3, 4], 3, 0) // => [4, 1, 2, 3]
Returns a new array with the item at
fromIndexmoved totoIndex.