|
|
9 лет назад | |
|---|---|---|
| .. | ||
| test | 9 лет назад | |
| .npmignore | 9 лет назад | |
| README.md | 9 лет назад | |
| index.js | 9 лет назад | |
| package.json | 9 лет назад | |
Create an object from from arrays of keys and values. (Inspired by lodash's _.zipObject)
npm install zip-object --save
Either takes two arrays or an array of arrays as the argument(s).
var zipObject = require('zip-object');
var zipped = zipObject(['key1', 'key2'], ['value1', 'value2']);
console.log(zipped.key1); // outputs 'value1'
console.log(zipped.key2); // outputs 'value2'
npm install
npm test