object-pair
v1.0.0
Published
Create an object from a key/value pair
Downloads
36
Maintainers
Readme
object-pair
Create an object from a key/value pair
Best used in ES5. In ES6-compatible environments just do this:
{[key]: value}
Install
$ npm install --save object-pair
Usage
var pair = require('object-pair')
pair('foo', 'bar')
//=> {foo: 'bar'}
API
pair(key, value)
-> object
key
Required
Type: string
value
Required
Type: any
License
MIT © Ben Drucker