{"ScriptPreparationCode":"var max2 = 100000;\r\n\r\nvar data = [];\r\nfor (var i = 0; i \u003C= max2; i\u002B\u002B) { data.push({ id: i }); }","TestCases":[{"Name":"lodash groupby","Code":"_.groupBy(data, ({ id }) =\u003E id)","IsDeferred":false},{"Name":"native reduce","Code":"const data_reduced = data.reduce((acc, item) =\u003E {\r\n if (item.id in acc) {\r\n acc[item.id].push(item)\r\n } else {\r\n acc[item.id] = [item]\r\n }\r\n return acc;\r\n}, {})","IsDeferred":false},{"Name":"group by simple for loop","Code":"const data_group_by_for_loop = {}\r\nfor (let i = 0; i \u003C data.length; i\u002B\u002B) {\r\n const item = data[i];\r\n if (item.id in data_group_by_for_loop) {\r\n data_group_by_for_loop[item.id].push(item)\r\n } else {\r\n data_group_by_for_loop[item.id] = [item]\r\n }\r\n}","IsDeferred":false}]}