MCPcopy
hub / github.com/jashkenas/underscore / findKey

Function findKey

underscore-esm.js:1258–1265  ·  view source on GitHub ↗
(obj, predicate, context)

Source from the content-addressed store, hash-verified

1256
1257// Returns the first key on an object that passes a truth test.
1258function findKey(obj, predicate, context) {
1259 predicate = cb(predicate, context);
1260 var _keys = keys(obj), key;
1261 for (var i = 0, length = _keys.length; i < length; i++) {
1262 key = _keys[i];
1263 if (predicate(obj[key], key, obj)) return key;
1264 }
1265}
1266
1267// Internal function to generate `_.findIndex` and `_.findLastIndex`.
1268function createPredicateIndexFinder(dir) {

Callers

nothing calls this directly

Calls 3

predicateFunction · 0.85
cbFunction · 0.70
keysFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…