1.0.1 • Published 9 years ago

associate-arrays v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

associate-arrays Build Status

Use an array of keys and an array of values to create an object

Install

$ npm install --save associate-arrays

Usage

var associateArrays = require('associate-arrays');

var animals = ['cow', 'pig', 'dog', 'cat'];
var sounds = ['Moo', 'Oink', 'Woof', 'Miao'];

associateArrays(animals, sounds);
//=> {cow: 'Moo', pig: 'Oink', dog: 'Woof', cat: 'Miao'}

API

associateArrays(keys, values)

keys

Required
Type: array

Array of keys.

values

Required
Type: array

Array of values.

License

MIT © Arthur Verschaeve