{"ScriptPreparationCode":"var data = []\r\n \r\nfor (var x = 1; x \u003C= 100000; x\u002B\u002B) {\r\n data.push({ x: x, y: Math.floor(Math.random() * (1000000)) })\r\n}","TestCases":[{"Name":"Reduce","Code":"function getMinY() {\r\n return data.reduce((min, p) =\u003E p.y \u003C min ? p.y : min, data[0].y);\r\n}\r\nfunction getMaxY() {\r\n return data.reduce((max, p) =\u003E p.y \u003E max ? p.y : max, data[0].y);\r\n}\r\n\r\nconst min = getMinY();\r\nconst max = getMaxY();","IsDeferred":false},{"Name":"For","Code":"function getMinY(){\r\n var minY = data[0];\r\n for (var i = 1; i \u003C data.length; i\u002B\u002B) {\r\n if (data[i] \u003C minY) {\r\n minY = data[i];\r\n }\r\n }\r\n return minY;\r\n}\r\n\r\nfunction getMaxY(){\r\n var maxY = data[0];\r\n for (var i = 1; i \u003C data.length; i\u002B\u002B) {\r\n if (data[i] \u003E maxY) {\r\n maxY = data[i];\r\n }\r\n }\r\n return maxY;\r\n}\r\n\r\nvar min = getMinY();\r\nvar max = getMaxY();","IsDeferred":false}]}