npm.io
1.0.1 • Published 9 years ago

array-to-hash

Licence
MIT
Version
1.0.1
Deps
2
Vulns
0
Weekly
0
Stars
1

array-to-hash Build Status

Copy array values as hash keys

Install

$ npm install --save array-to-hash

Usage

var arrayToHash = require('array-to-hash')

arrayToHash(['foo', 'bar'])
//=> {foo: undefined, bar: undefined}

API

arrayToHash(array) -> object

Returns an object. The object has no prototype, so inherited object methods like hasOwnProperty will be unavailable.

array

Required
Type: array[strings]

An array of strings to use as hash keys.

License

MIT Ben Drucker

Keywords