ohctechv3/.svn/pristine/e3/e38e2c7d6b7a7ddec0ca1545020b1d3ea312c868.svn-base
2024-10-28 15:03:36 +05:30

26 lines
728 B
Plaintext

import createFind from './_createFind.js';
import findLastIndex from './findLastIndex.js';
/**
* 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);
export default findLast;