array-to-hash

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i array-to-hash

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bendrucker