delete
Returns a copy of the array without the item at the provided index. The original array is not mutated because the implementation uses toSpliced, making it suitable for immutable state updates in UI code.
Usage
ts
const values = ['draft', 'published', 'archived'];
const nextValues = values.delete(1);
// ['draft', 'archived']Parameters
| Name | Type | Description |
|---|---|---|
index | number | Index to remove. |
Returns
A new array without the item at index.
Type signature
ts
interface Array<T> {
delete(index: number): T[];
}