@tempots/std
removeOneFromArray() function
Removes the first occurrence of an item from an array.
Signature:
removeOneFromArray: (arr: A[], item: A) => boolean
Parameters
Parameter |
Type |
Description |
---|---|---|
arr |
A[] |
The array from which to remove the item. |
item |
A |
The item to remove from the array. |
Returns: boolean
true
if the item was found and removed, false
otherwise.