用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
## findLast + [link](./findLast "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L7644 "View in source.") + [npm](https://www.npmjs.com/package/lodash.findlast "See the npm package.") ``` _.findLast(collection, [predicate=_.identity]) ``` 这个方法类似 `_.find`,除了它是从右至左遍历集合的。 ### 参数 1. collection (Array|Object) 要检索的集合 2. [predicate=_.identity] (Function|Object|string) 这个函数会处理每一个元素 ### 返回值 (\*) 返回匹配元素,否则返回 `undefined` ### 示例 ``` _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3 ```