Skip to content

moveItem

moveItem<T>(from, to, item, index?): boolean

Defined in: src/modules/pile/pile-array.ts:46

Move one item from from into to at index (default: on top). The first === match in from is removed first, so with from === to index counts positions after that removal, which is how you reorder an array. An out-of-range index is clamped and a fractional one truncated.

Returns false — changing neither array — when item is not in from.

T

T[]

T[]

T

number

boolean