diginext-utils
Version:
README.md
18 lines • 574 B
TypeScript
/**
* Removes the first occurrence of an item from an array.
* Returns a new array without modifying the original.
*
* @template T - The type of elements in the array
* @param array - The array to remove from
* @param item - The item to remove
* @returns A new array with the item removed
*
* @example
* ```ts
* removeItem([1, 2, 3, 2], 2); // [1, 3, 2]
* removeItem(['a', 'b', 'c'], 'b'); // ['a', 'c']
* removeItem([1, 2, 3], 4); // [1, 2, 3]
* ```
*/
export declare function removeItem<T>(array: T[], item: T): T[];
//# sourceMappingURL=removeItem.d.ts.map