Update zipObject.md

This commit is contained in:
Robert Mennell
2017-12-20 15:04:32 -08:00
committed by GitHub
parent 52902ad97a
commit c235295b5b

View File

@ -6,8 +6,7 @@ Since an object can have undefined values but not undefined property pointers, t
```js
const zipObject = ( props, values ) => props.reduce( ( obj, prop, index ) => ( obj[prop] = values[index], obj ), {} )
/*
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}
```