obj-numeric
v1.0.0
Published
Create an object with incremented numeric values from an array of keys
Downloads
2
Maintainers
Readme
obj-numeric
Create an object with incremented numeric values from an array of keys
Install
$ npm install --save obj-numeric
Usage
var objNumeric = require('obj-numeric')
objNumeric(['foo', 'bar'])
//=> {foo: 0, bar: 1}
objNumeric(['foo', 'bar'], 1)
//=> {foo: 1, bar: 2}
API
objNumeric(keys, [offset])
-> object
keys
Required
Type: array
An array of keys to add to the output object.
offset
Type: number
Default: 0
An offset for each number.
License
MIT © Ben Drucker