{"ScriptPreparationCode":"var arr = [\r\n { key: \u0027one\u0027, val: 1 },\r\n { key: \u0027two\u0027, val: 2 },\r\n { key: \u0027three\u0027, val: 3 },\r\n { key: \u0027four\u0027, val: 4 },\r\n { key: \u0027five\u0027, val: 5 },\r\n { key: \u0027six\u0027, val: 6 },\r\n { key: \u0027seven\u0027, val: 7 },\r\n { key: \u0027eight\u0027, val: 8 },\r\n { key: \u0027nine\u0027, val: 9 },\r\n { key: \u0027ten\u0027, val: 10 },\r\n { key: \u0027eleven\u0027, val: 11 },\r\n { key: \u0027twelve\u0027, val: 12 },\r\n { key: \u0027thirteen\u0027, val: 13 },\r\n { key: \u0027fourteen\u0027, val: 14 },\r\n { key: \u0027fifteen\u0027, val: 15 },\r\n { key: \u0027sixteen\u0027, val: 16 },\r\n { key: \u0027seventeen\u0027, val: 17 },\r\n { key: \u0027eighteen\u0027, val: 18 },\r\n { key: \u0027nineteen\u0027, val: 19 },\r\n { key: \u0027twenty\u0027, val: 20 }\r\n];","TestCases":[{"Name":"Immutable reducer via spread operator","Code":"const reducer = (obj, pair) =\u003E \r\n ({...obj, [pair.key]: pair.val });\r\narr.reduce(reducer, {});","IsDeferred":false},{"Name":"Mutable reducer via property assign","Code":"const reducer = (obj, pair) =\u003E {\r\n obj[pair.key] = pair.val;\r\n return Object.assign({}, obj);\r\n};\r\narr.reduce(reducer, {});","IsDeferred":false}]}