1.0.0 • Published 7 years ago
object-first-key v1.0.0
object-first-key
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
1.0.0
7 years ago