(arr: T[], index: number, newItem: T)
| 20 | * Immutable insert function |
| 21 | */ |
| 22 | export function insert<T>(arr: T[], index: number, newItem: T): T[] { |
| 23 | return [...arr.slice(0, index), newItem, ...arr.slice(index)]; |
| 24 | } |
| 25 | |
| 26 | /* |
| 27 | * Immutable multiInsert function that inserts values into an array at given indeces |
no outgoing calls
no test coverage detected