@wezom/toolkit-array
Version:
Useful tools for working with Arrays
9 lines (8 loc) • 304 B
TypeScript
/**
* Clones an array and removes items by index
* @immutable
* @example
* arrayRemoveByIndex(['A', 'B', 'C'], 1) // >>> ['A', 'C'];
* arrayRemoveByIndex(['A', 'B', 'C', 'D', 'E'], 1, 3) // >>> ['A', 'E'];
*/
export default function <T = any>(array: T[], index: number, deleteCount?: number): T[];