{"ScriptPreparationCode":"const reduceArrayOfObjectOld = (list, key) =\u003E {\r\n if (!list) {\r\n throw new Error(\u0060Empty list\u0060);\r\n }\r\n if (!key) {\r\n throw new Error(\u0060Empty key\u0060);\r\n }\r\n const len = list.length;\r\n const result = new Array(len);\r\n for (let index = 0; index \u003C len; index\u002B\u002B) {\r\n result[index] = list[index][key];\r\n }\r\n return result;\r\n};\r\nconst reduceArrayOfObjectNew = (list, key) =\u003E {\r\n if (!list) {\r\n throw new Error(\u0060Empty list\u0060);\r\n }\r\n if (!key) {\r\n throw new Error(\u0060Empty key\u0060);\r\n }\r\n const len = list.length;\r\n const result = new Array(len);\r\n let index = 0;\r\n for (; index \u003C len; index\u002B\u002B) {\r\n result[index] = list[index][key];\r\n }\r\n return result;\r\n};\r\n\r\nconst DATA = new Array(1000).fill({a: 1});","TestCases":[{"Name":"reduceArrayOfObjectOld","Code":"reduceArrayOfObjectOld(DATA, \u0027a\u0027)","IsDeferred":false},{"Name":"reduceArrayOfObjectNew","Code":"reduceArrayOfObjectNew(DATA, \u0027a\u0027)","IsDeferred":false}]}