associate-arrays

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i associate-arrays

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • arthurvr