{"ScriptPreparationCode":"var array = new Array(1000).fill(Math.random(1000) * 1000);","TestCases":[{"Name":"Classic for loop","Code":"let sum = 0;\r\nfor (let i=0; i \u003C array.length; i\u002B\u002B) {\r\n sum \u002B= array[i];\r\n}","IsDeferred":false},{"Name":"Optimised classic for loop","Code":"let sum = 0;\r\nfor (let i=0, len=array.length; i \u003C len; i\u002B\u002B) {\r\n sum \u002B= array[i];\r\n}","IsDeferred":false},{"Name":"While loop","Code":"let sum = 0;\r\nlet i = 0;\r\n\r\nwhile (i \u003C array.length) {\r\n\tsum \u002B= array[i];\r\n \ti\u002B\u002B;\r\n}\r\n","IsDeferred":false},{"Name":"Optimised while loop","Code":"let sum = 0;\r\nlet i = 0;\r\nlet len = array.length;\r\n\r\nwhile (i \u003C len) {\r\n\tsum \u002B= array[i];\r\n \ti\u002B\u002B;\r\n}","IsDeferred":false},{"Name":"Array.prototype.forEach","Code":"let sum = 0;\r\narray.forEach(num =\u003E sum \u002B= num);","IsDeferred":false},{"Name":"Array.prototype.reduce","Code":"const sum = array.reduce((acc, el) =\u003E acc \u002B el, 0);","IsDeferred":false},{"Name":"For - of loop","Code":"let sum = 0;\r\nfor (let el of array) {\r\n sum \u002B= el;\r\n}","IsDeferred":false},{"Name":"For - in loop","Code":"let sum = 0;\r\nfor (let i in array) {\r\n sum \u002B= array[i];\r\n}","IsDeferred":false}]}