{"ScriptPreparationCode":"const toSearch = [];\r\nfor (let index = 0; index \u003C 5000; index\u002B\u002B) {\r\n toSearch.push({\r\n x: Math.random(),\r\n y: Math.random()\r\n });\r\n}\r\ntoSearch.push({\r\n x: 1,\r\n y: 1\r\n });","TestCases":[{"Name":"Loop","Code":"let max = 0;\r\n\r\nfor (let i = 0; i \u003C toSearch.length; i\u002B\u002B) {\r\n if (toSearch[i].x \u003E max) {\r\n max = toSearch[i].x;\r\n }\r\n}","IsDeferred":false},{"Name":"Math.max.apply","Code":"let max = Math.max.apply(null,\r\n toSearch.map(function (o) { return o.x; }));","IsDeferred":false},{"Name":"Reduce","Code":"let max = toSearch.reduce((acc, value) =\u003E {\r\n return (acc = acc \u003E value.x ? acc : value.x);\r\n}, 0);","IsDeferred":false},{"Name":"Sort","Code":"toSearch.sort((one, two) =\u003E two.x - one.x); \r\nlet max = toSearch[0].x; ","IsDeferred":false}]}