moveElementInArray

export function moveElementInArray(array: unknown[], element: unknown, newIndex: number, offset?: boolean): number;
export function moveElementInArray(array: unknown[], element: unknown, newIndex: number, offset?: boolean): number;
Moves an element in an array *in place*.
NameTypeOptionalDescription
arrayunknown[]NoArray to modify
elementunknownNoElement to move
newIndexnumberNoIndex or offset to move the element to
offsetbooleanYesMove the element by an offset amount rather than to a set index