I am new to javascript and I want to loop through json data and add accumulative number to the end of it. Here is a sample dataset:
[{'a':123,'b':345,'c':{'b1':1,'b2':2,'b3':3}},
{'a':234,'b':456,'c':{'b1':2,'b2':4,'b3':6}},
{'a':345,'b':567,'c':{'b1':3,'b2':6,'b3':9}}]
And this is what I want to achieve:
[{'a':123,'b':345,'c':{'b1':1,'b2':2,'b3':3},'d':345+1+2+3},
{'a':234,'b':456,'c':{'b1':2,'b2':4,'b3':6},'d':456+2+4+6},
{'a':345,'b':567,'c':{'b1':3,'b2':6,'b3':9},'d':567+3+6+9}]