@tempots/std
removeOneFromArrayByPredicate() function
Removes the first occurrence in an array that satisfy the given predicate.
Signature:
removeOneFromArrayByPredicate: (arr: A[], predicate: (a: A) => boolean) => boolean
Parameters
Parameter |
Type |
Description |
---|---|---|
arr |
A[] |
The array from which elements will be removed. |
predicate |
(a: A) => boolean |
The predicate function used to determine which elements to remove. |
Returns: boolean
true
if at least one element was removed, false
otherwise.