MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / baseFind

Function baseFind

lib/web/jshint.js:3483–3492  ·  view source on GitHub ↗

* The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`, * without support for callback shorthands and `this` binding, which iterates * over `collection` using the provided `eachFunc`. * * @private * @param {Array|Object|string} collection The c

(collection, predicate, eachFunc, retKey)

Source from the content-addressed store, hash-verified

3481 * @returns {*} Returns the found element or its key, else `undefined`.
3482 */
3483 function baseFind(collection, predicate, eachFunc, retKey) {
3484 var result;
3485 eachFunc(collection, function(value, key, collection) {
3486 if (predicate(value, key, collection)) {
3487 result = retKey ? key : value;
3488 return false;
3489 }
3490 });
3491 return result;
3492 }
3493
3494 /**
3495 * The base implementation of `_.flatten` with added support for restricting

Callers 2

createFindFunction · 0.85
createFindKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected