You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
357 B
13 lines
357 B
var safeCb = require('./safeCb'); |
|
var keys = require('./keys'); |
|
exports = function(obj, predicate, ctx) { |
|
predicate = safeCb(predicate, ctx); |
|
var _keys = keys(obj); |
|
var key; |
|
for (var i = 0, len = _keys.length; i < len; i++) { |
|
key = _keys[i]; |
|
if (predicate(obj[key], key, obj)) return key; |
|
} |
|
}; |
|
|
|
module.exports = exports;
|
|
|