项目原始demo,不改动
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

_keyof.js 309 B

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