I'm struggling with what seems like a basic issue. I have an array that looks like this:
var myArray = [{a:3, b:4, c:5}, {a:-1, b:3, c:5}, {a:0, b:-3, c:1}];
I need to create a loop to add up all the values for 'a', 'b', and 'c' in each object of the array. The challenge is that I don't know how many objects will be in the array beforehand.
For example, instead of manually adding up the values like this:
var A = myArray[0].a + myArray[1].a + myArray[2].a;