{"ScriptPreparationCode":"// Create an array of 1000 random intergers between 1 and 10000\r\nvar arrRandom = [];\r\nfor(var intCtr=0; intCtr\u003C1000; intCtr\u002B\u002B) {\r\n arrRandom.push(Math.floor(Math.random() * Math.floor(10000)));\r\n}\r\n\r\nfunction reduceCallback(accum, curr) {\r\n accum.push(curr);\r\n\treturn accum;\r\n}\r\n\r\nfunction doRedeuce(pArray) {\r\n\treturn pArray.reduce((arr, item) =\u003E {\r\n \tarr.push(item);\r\n return arr;\r\n }, []);\r\n}\r\nfunction doLoop(pArray) {\r\n\tvar accum = [];\r\n\tfor(var intCtr=0; intCtr\u003CpArray.length; intCtr\u002B\u002B) {\r\n\t\taccum.push(pArray[intCtr]);\r\n\t}\r\n\treturn accum;\r\n}\r\nfunction doForEach(pArray) {\r\n\tvar accum = [];\r\n\tpArray.forEach(function(item) {\r\n\t\taccum.push(item)\r\n\t});\r\n}","TestCases":[{"Name":"reduce","Code":"var redeuceResult=[];\r\nredeuceResult = doRedeuce(arrRandom);","IsDeferred":false},{"Name":"foreach","Code":"var forEachResult=[];\r\nforEachResult = doForEach(arrRandom)","IsDeferred":false}]}