mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
9 lines
223 B
TypeScript
9 lines
223 B
TypeScript
/**
|
|
* Remove item at `index` in `array` without mutating `array`
|
|
*/
|
|
export function removeAtArrayIndex<T>(array: T[], index: number): T[] {
|
|
const newArray = [...array];
|
|
newArray.splice(index, 1);
|
|
return newArray;
|
|
}
|