first-key.js 287 B

12345678910111213
  1. "use strict";
  2. var value = require("./valid-value")
  3. , objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  4. module.exports = function (obj) {
  5. var i;
  6. value(obj);
  7. for (i in obj) {
  8. if (objPropertyIsEnumerable.call(obj, i)) return i;
  9. }
  10. return null;
  11. };