spliceDelete
The spliceDelete() function deletes a given number of elements from an index and returns a new cleaned-up array.
Interactive example
Syntax
Classic signature
typescript
function spliceDelete<
GenericInput extends readonly unknown[]
>(
input: GenericInput,
indexTo: number,
deleteCount: number
): GenericInputCurried signature
typescript
function spliceDelete<
GenericInput extends readonly unknown[]
>(
indexTo: number,
deleteCount: number
): (input: GenericInput) => GenericInputParameters
input: Source array.indexTo: Index where deletion starts.deleteCount: Number of elements to remove.
Return value
A new array without the targeted elements.
See also
spliceInsert- Inserts elements at an indexspliceReplace- Replaces a portion with another
