{"ScriptPreparationCode":"var objects = Array.from(new Array(2000)).map((r, i) =\u003E ({\r\n id: \u0060id-${i}\u0060,\r\n propA: Array.from(new Array(20000)).map((r, i) =\u003E ({ nested: i })),\r\n propB: Array.from(new Array(20000)),\r\n}));","TestCases":[{"Name":"Populate object via ForEach","Code":"var newMapFE = {};\r\nobjects.forEach(o =\u003E { newMapFE[o.id] = o.val })","IsDeferred":false},{"Name":"Populate object via Reduce","Code":"objects.reduce((acc, item) =\u003E ({...acc, [item.id]: item.val}), {});","IsDeferred":false},{"Name":"Populate object via Reduce (optimized)","Code":"objects.reduce((acc, item) =\u003E {\r\n acc[item.id] = item.val;\r\n return acc;\r\n}, {});","IsDeferred":false},{"Name":"Populate object via For ... Of","Code":"var newMapFE = {};\r\n\r\nfor (obj in objects) {\r\n\tnewMapFE[obj.id] = obj.val\r\n}","IsDeferred":false},{"Name":"Populate object via Object.entries (for of)","Code":"var newMapFE = {};\r\nfor (const [key, value] of Object.entries(objects)) {\r\n newMapFE[key] = value;\r\n}","IsDeferred":false},{"Name":"Populate object via Object.entries (foreach)","Code":"var newMapFE = {};\r\nObject.entries(objects).forEach(([key, value]) =\u003E {\r\n newMapFE[key] = value;\r\n});","IsDeferred":false}]}