filter
Summary
Returns a new list with only the elements that passed a predicate.
Tip
This function is curried.
Description
Keeps the elements in xs
that satisfied the predicate fn
and returns a new list of the same type. The predicate must return logical true.
Examples
Works with arrays and objects
1 2 3 4 5 6 7 |
|
Parameters
Name | Type | Description |
---|---|---|
pred | function |
|
xs | Array or Object |
Return
Array
or Object