{"ScriptPreparationCode":" var arr = [];\r\n\r\n\tfunction resetArray(){\r\n for (var i = 0; i \u003C 1000; i\u002B\u002B) {\r\n arr[i] = i;\r\n }\r\n }\r\n \r\n function someFn(i) {\r\n return i * 3 * 8;\r\n }\r\n\r\n\tresetArray()","TestCases":[{"Name":"for - create new array","Code":"resetArray()\r\nvar forArray = []\r\nvar length = arr.length\r\nfor (var i = 0; i \u003C length; i\u002B\u002B) {\r\n forArray.push(someFn(arr[i]));\r\n}","IsDeferred":false},{"Name":"forEach - create new array","Code":"resetArray()\r\nvar forEachArray = []\r\narr.forEach(function (item, index){\r\n forEachArray.push(someFn(item));\r\n})","IsDeferred":false},{"Name":"map - create new array","Code":"resetArray()\r\nvar mapNewArray = [];\r\nmapNewArray = arr.map(function(item){\r\n\treturn someFn(item)\r\n})","IsDeferred":false},{"Name":"for - overwrite array","Code":"resetArray()\r\nvar len = arr.length\r\nfor (var i = 0; i \u003C len; i\u002B\u002B) {\r\n arr[i] = someFn(arr[i]);\r\n}","IsDeferred":false},{"Name":"forEach - overwrite array","Code":"resetArray()\r\narr.forEach(function (item, index){\r\n arr[index] = someFn(item);\r\n})","IsDeferred":false},{"Name":"map - overwrite array","Code":"resetArray()\r\narr = arr.map(function(item, index){\r\n\treturn someFn(item)\r\n})","IsDeferred":false}]}