Return a copy of arr with the element at from relocated to index to (standard splice-move semantics: remove, then insert at to). Returns an unchanged copy when either index is out of range. Never mutates the input.
arr
from
to
The array element type.
The source array (not mutated).
The index of the element to move.
The destination index in the resulting array.
A new array with the element moved.
Return a copy of
arrwith the element atfromrelocated to indexto(standard splice-move semantics: remove, then insert atto). Returns an unchanged copy when either index is out of range. Never mutates the input.