method Array.splice
Private
Array.splice(
start: number,
deleteCount?: number,
): T[]

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

start: number

The zero-based location in the array from which to start removing elements.

optional
deleteCount: number

The number of elements to remove.

Return Type

T[]

An array containing the elements that were deleted.

Array.splice(
start: number,
deleteCount: number,
...items: T[],
): T[]

Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

Parameters

start: number

The zero-based location in the array from which to start removing elements.

deleteCount: number

The number of elements to remove.

...items: T[]

Return Type

T[]

An array containing the elements that were deleted.