UNPKG

@stewartmac/lotide

Version:

Modular collection of functions that operate on data, namely Arrays and Objects.

8 lines (7 loc) 189 B
const findKey = function(object, callback) { const objKeys = Object.keys(object); for (let key of objKeys) { if (callback(object[key])) return key; } }; module.exports = findKey;