Urara-Blog/node_modules/.pnpm-store/v3/files/f2/e48e34d0ad272210ff364cc6d28aeec9e13c720a4483ef9e16f18f1f07856af620e07e1306343298de43174a633afe08ba47ad744fed8ee70df22305e6101f
2022-08-14 01:14:53 +08:00

25 lines
730 B
Text

var createFind = require('./_createFind'),
findLastIndex = require('./findLastIndex');
/**
* This method is like `_.find` except that it iterates over elements of
* `collection` from right to left.
*
* @static
* @memberOf _
* @since 2.0.0
* @category Collection
* @param {Array|Object} collection The collection to inspect.
* @param {Function} [predicate=_.identity] The function invoked per iteration.
* @param {number} [fromIndex=collection.length-1] 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
*/
var findLast = createFind(findLastIndex);
module.exports = findLast;