So I'm trying to copy these subarrays into another array and change them so their values are cumulative as I put them in. In order to make them cumulative, I am using the map function and modeling that based on the constant variable I made. In my attempts to copy them over into the other array, I have tried concat, push, and other methods without success.
JS
const cumulative = (cumu => val => cumu += val)(0);
var series2 = series.map(cumulative);
series: [
[55, 65, 76, 88, 44, 33, 54, 65, 7, 98, 12, 109],
[52, 25, 26, 82, 24, 23, 34, 65, 47, 59, 12, 19],
[57, 68, 77, 78, 44, 43, 74, 16, 71, 91, 11, 29]
]
This array below is just to demonstrate the desired effect I am attempting to do...
series2: [
[55, 120, 196... etc...],
[...],
[...]
]