object-first-key

1.0.0 • Public • Published

object-first-key Build Status

Returns the first own key of an object

Install

Ensure you have Node.js version 4 or higher installed. Then run the following:

$ npm install object-first-key

Usage

// ES5
const objectFirstKey = require('object-first-key');
// ES2015+
import objectFirstKey from 'object-first-key';
 
objectFirstKey({ hello: 'world' }) === 'hello';
objectFirstKey({}) === undefined;

The return value for an object with more than one own property keys is intentionally left unspecified.

License

MIT © Cameron Knight

Package Sidebar

Install

npm i object-first-key

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ckknight