{"ScriptPreparationCode":"var values = new Array(10000);\r\n\r\nfor (let i = 0; i \u003C values.length/2; i\u002B=2) {\r\n values[i] = {\r\n type: \u0022A\u0022\r\n };\r\n \tvalues[i\u002B1] = {\r\n type: \u0022B\u0022\r\n };\r\n}","TestCases":[{"Name":"Reduce","Code":"return values.reduce(function(obj, value) {\r\n const key = value.type;\r\n if (obj[key] == null) obj[key] = [];\r\n obj[key].push(value);\r\n return obj;\r\n}, {});","IsDeferred":false},{"Name":"For Each","Code":"const obj = {}\r\nreturn values.forEach(function(value) {\r\n const key = value.type;\r\n if (obj[key] == null) obj[key] = [];\r\n obj[key].push(value);\r\n});","IsDeferred":false}]}