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