function moveElementInArray

export function moveElementInArray(array: unknown[], element: unknown, newIndex: number, offset?: boolean): number;

Moves an element in an array *in place*.

Parameters

array: unknown[]
Array to modify
element: unknown
Element to move
newIndex: number
Index or offset to move the element to
optional
offset?: boolean
Move the element by an offset amount rather than to a set index