Moves an element in an array to a new position within the same array. The array is modified in-place.
name | type | description |
---|---|---|
array | array |
The array. |
item | * |
The element to move. |
index | number |
The new index that the element will be moved to. |
The element that was moved.