MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / findKey

Function findKey

MathBox/mathbox-bundle.js:37055–37065  ·  view source on GitHub ↗

* This method is like `_.findIndex` except that it returns the key of the * first element that passes the callback check, instead of the element itself. * * If a property name is provided for `callback` the created "_.pluck" style * callback will return the property value of the

(object, callback, thisArg)

Source from the content-addressed store, hash-verified

37053 * // => 'fred'
37054 */
37055 function findKey(object, callback, thisArg) {
37056 var result;
37057 callback = lodash.createCallback(callback, thisArg, 3);
37058 forOwn(object, function(value, key, object) {
37059 if (callback(value, key, object)) {
37060 result = key;
37061 return false;
37062 }
37063 });
37064 return result;
37065 }
37066
37067 /**
37068 * This method is like `_.findKey` except that it iterates over elements

Callers

nothing calls this directly

Calls 2

forOwnFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected