{"ScriptPreparationCode":"var arr = [];\r\nfor (var i = 0; i \u003C 12345; i\u002B\u002B) {\r\n arr[i] = i;\r\n}\r\n\r\nfunction someFn(i) {\r\n return (i % 5);\r\n}\r\n\r\nvar sumForEach = 0,\r\n sumReduce = 0,\r\n sumMap = 0,\r\n sumFilter = 0,\r\n sumFor = 0;","TestCases":[{"Name":"forEach","Code":"let newArr = []\r\narr.forEach(item =\u003E {\r\n if(item) newArr.push(item)\r\n});","IsDeferred":false},{"Name":"reduce","Code":"let newArr = arr.reduce((lastValue, item) =\u003E {\r\n if(item) lastValue.push(item);\r\n return lastValue\r\n}, []);","IsDeferred":false},{"Name":"for","Code":"let newArr = []\r\nfor (let j of arr) {\r\n if(j) newArr.push(j);\r\n}","IsDeferred":false},{"Name":"map and filter","Code":"let newArr = arr.map(a =\u003E a ? a : false).filter(a =\u003E a)","IsDeferred":false}]}