CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
find.js43 linesDownload Raw Back to lodash-es
1import createFind from './_createFind.js';2import findIndex from './findIndex.js';3 4/**5 * Iterates over elements of `collection`, returning the first element6 * `predicate` returns truthy for. The predicate is invoked with three7 * arguments: (value, index|key, collection).8 *9 * @static10 * @memberOf _11 * @since 0.1.012 * @category Collection13 * @param {Array|Object} collection The collection to inspect.14 * @param {Function} [predicate=_.identity] The function invoked per iteration.15 * @param {number} [fromIndex=0] The index to search from.16 * @returns {*} Returns the matched element, else `undefined`.17 * @example18 *19 * var users = [20 *   { 'user': 'barney',  'age': 36, 'active': true },21 *   { 'user': 'fred',    'age': 40, 'active': false },22 *   { 'user': 'pebbles', 'age': 1,  'active': true }23 * ];24 *25 * _.find(users, function(o) { return o.age < 40; });26 * // => object for 'barney'27 *28 * // The `_.matches` iteratee shorthand.29 * _.find(users, { 'age': 1, 'active': true });30 * // => object for 'pebbles'31 *32 * // The `_.matchesProperty` iteratee shorthand.33 * _.find(users, ['active', false]);34 * // => object for 'fred'35 *36 * // The `_.property` iteratee shorthand.37 * _.find(users, 'active');38 * // => object for 'barney'39 */40var find = createFind(findIndex);41 42export default find;43 
basant307/AI_Governance_Project · CoolFace