The picture below shows the arrays I am pulling from HealthKit's step counter. The arrays have step count values of 33 + 97 + 75.
I'm not sure how to grab the second index in each array and add them together to get 205.
I am currently using:
let stepSum = (data as any).reduce((a, b) => a + b.quantity, 0);
This logs arrays correctly :
console.log(data as any);
This link below is the closest thing I could find, but I am not sure how to apply it to only one index. How to sum elements at the same index in array of arrays into a single array?
Thanks in advance for any help!
I am using Ionic Framework (HTML/CSS files) and Angular (TS files).