{"ScriptPreparationCode":"var data = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];\r\nvar ndata = data.reduce((acc, value, index) =\u003E {\r\n acc[index] = (acc[index - 1] || 0) \u002B value;\r\n return acc;\r\n }, []);","TestCases":[{"Name":"Slice and reduce","Code":"var copy = [...ndata.slice(0, 2), ...data.slice(3,9).reduce((acc, value, index) =\u003E {\r\n acc[index] = (acc[index - 1] || 0) \u002B value;\r\n return acc;\r\n }, []) ];","IsDeferred":false},{"Name":"For loop","Code":"var copy = [...ndata.slice(0, 2)];\r\nfor (var i = 3; i \u003C 8; i\u002B\u002B) {\r\n copy[i] = (ndata[i] || 0) \u002B 34;\r\n}","IsDeferred":false}]}