I'm using app script
I have Return array from API by this code :
const price= jsonResponce.price.map(obj => [obj[0],obj[1]]);
Give me [[30.56, 1.014], [50.44, 1.019], [10.35, 1.081], [10.34, 1.115], [10.40, 2.006]]
Not this array can be has 1000 array or large
Now I want to sum all object in obj[0] by using this code :
I use to method to see the deference but nothing work
var first= [];
var second= 0;
price.forEach(function(obj){
first+= obj[0];
second+= obj[1];
});
Logger.log(first);
Logger.log(second);
But Give me result like that: first Logger.log(first);
30.5650.4410.3510.3410.40
second Logger.log(second);
: this method add number 0 after any obj
01.01401.01901.08101.11502.006
Any idea for this problem
30.56+50.44+10.35+10.34+10.40 I need result as : 112.09