npm.io
1.0.0 • Published 9 years ago

object-first-key

Licence
MIT
Version
1.0.0
Deps
0
Vulns
0
Weekly
0
Stars
1

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

Keywords