Travis build: 391

This commit is contained in:
Travis CI
2017-12-28 08:30:19 +00:00
parent 294a22ea5e
commit 203edf9ba2
141 changed files with 1389 additions and 1044 deletions

View File

@ -5,10 +5,11 @@ Given an array of valid property identifiers and an array of values, return an o
Since an object can have undefined values but not undefined property pointers, the array of properties is used to decide the structure of the resulting object using `Array.reduce()`.
```js
const zipObject = (props, values) => props.reduce((obj, prop, index) => (obj[prop] = values[index], obj), {});
const zipObject = (props, values) =>
props.reduce((obj, prop, index) => ((obj[prop] = values[index]), obj), {});
```
```js
zipObject(['a','b','c'], [1,2]) // {a: 1, b: 2, c: undefined}
zipObject(['a','b'], [1,2,3]) // {a: 1, b: 2}
zipObject(['a', 'b', 'c'], [1, 2]); // {a: 1, b: 2, c: undefined}
zipObject(['a', 'b'], [1, 2, 3]); // {a: 1, b: 2}
```