instance method Enumerable#findAll
Enumerable#findAll(iterator[, context]) → Array
-
iterator
(Function
) – An iterator function to use to test the elements. -
context
(Object
) – An optional object to use asthis
within calls to the iterator.
Returns all the elements for which the iterator returned a truthy value.
For the opposite operation, see Enumerable#reject
.
Example
[1, 'two', 3, 'four', 5].findAll(Object.isString);
// -> ['two', 'four']
Aliased as: Enumerable#select
, Enumerable#filter