I would like to create a sum of an array with multiple objects.
Here is an example:
var array = [{"adults":2,"children":3},{"adults":2,"children":1}];
How do I return the sum of adults and the sum of children into a new variable for each?
Thanks,
c.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…