fn
remove
v0.0.10testedReturn a new array with the item at `index` removed. Returns a shallow copy unchanged when the index is out of range. Never mutates.
Example
ts
remove(['a', 'b', 'c'], 1); // ['a', 'c']Signature
ts
export function remove<T>(array: readonly T[], index: number): T[]{ ... }Type Parameters
TParameters
| Parameter | Type | Description |
|---|---|---|
array | readonly T[] | The source array |
index | number | Index of the item to remove |
Returns
T[]A new array without the removed item