4.17.11
3.10.1
2.4.2
1.3.1
_.findLast(collection, [predicate=_.identity], [fromIndex=collection.length-1])
This method is like _.find
except that it iterates over elements of
collection
from right to left.
Since
2.0.0
Arguments
argument
collection
[predicate=_.identity]
[fromIndex=collection.length-1]
type
(Array|Object)
Function
number
description
The collection to inspect.
The function invoked per iteration.
The index to search from.
Returns
(array)
Example
_.findLast([1, 2, 3, 4], function (n) {
return n % 2 == 1;
});
// => 3
_.findLast([1, 2, 3, 4], function (n) {
return n % 2 == 1;
});
// => 3