From 8554fa507a6a76e1df39e6456aba846a18f90300 Mon Sep 17 00:00:00 2001 From: Robert Mennell Date: Wed, 20 Dec 2017 15:03:40 -0800 Subject: [PATCH] Update zipObject.md --- snippets/zipObject.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/zipObject.md b/snippets/zipObject.md index bc9ecc010..ab8ac6ee5 100644 --- a/snippets/zipObject.md +++ b/snippets/zipObject.md @@ -5,7 +5,7 @@ Given an Array of valid property identifiers and an Array of values, `zipObject` 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 through a `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 ), {} ) /* zipObject(['a','b','c'], [1,2]) -> {a: 1, b: 2, c: undefined} zipObject(['a','b'], [1,2,3]) -> {a: 1, b: 2}