$.keyof.js 299 B

12345678910
  1. var $ = require('./$')
  2. , toIObject = require('./$.to-iobject');
  3. module.exports = function(object, el){
  4. var O = toIObject(object)
  5. , keys = $.getKeys(O)
  6. , length = keys.length
  7. , index = 0
  8. , key;
  9. while(length > index)if(O[key = keys[index++]] === el)return key;
  10. };