@tempots/std
removeAllFromArrayByPredicate() function
Removes all occurrences in an array that satisfy the given predicate.
Signature:
removeAllFromArrayByPredicate: (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.