MCPcopy
hub / github.com/lodash/lodash / baseFindKey

Function baseFindKey

lodash.js:790–799  ·  view source on GitHub ↗

* The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The fu

(collection, predicate, eachFunc)

Source from the content-addressed store, hash-verified

788 * @returns {*} Returns the found element or its key, else `undefined`.
789 */
790 function baseFindKey(collection, predicate, eachFunc) {
791 var result;
792 eachFunc(collection, function(value, key, collection) {
793 if (predicate(value, key, collection)) {
794 result = key;
795 return false;
796 }
797 });
798 return result;
799 }
800
801 /**
802 * The base implementation of `_.findIndex` and `_.findLastIndex` without

Callers 2

findKeyFunction · 0.85
findLastKeyFunction · 0.85

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected