Created https://codepen.io/Spawnes/pen/LYmVMJj in which place a large array of data. The task description will be duplicated here:
You need to add the values of X with all subsequent X
You need to add Y values with all subsequent Y
You need to add marker.color values followed by all marker.color
To end up with:
1) 1 frame unchanged
2) On the second frame, everything that was in the first + data from the second.
3) On the third frame, the sum of 1 and 2 + new data from the third frame.
4) On the fourth frame, the previous result + data from frame 4
And so on
I'll add another screenshot demonstrating the data itself: screenshot
As you can see, there are quite a lot of objects inside. And you just need to make an addition while maintaining the previous calculations.
1 + 2 = 3.
3 + 2 = 5
5 + 6 = 11
11 + 2 = 13