.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
collection
(Array|Object): The collection to inspect.[predicate=.identity]
(Function)_: The function invoked per iteration.[fromIndex=collection.length-1]
(number): The index to search from.
Returns
(*): Returns the matched element, else undefined
.
Example
_.findLast([1, 2, 3, 4], function(n) {return n % 2 == 1;});// => 3
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .