I have a list of array. Avery array has an object, and I want to get the value of this object
My code as follow:
var data =[]
var children= response.data.children
children.forEach(function (child) {
if(equipes.hasOwnProperty(child['id'])) {
total += equipes[child['id']];
dataequipes.push({
id: child['id'],
total: equipes[child['id']]
});
}
});
series.domain = domainId;
series.total = total;
series.details = dataequipes;
data.push(series);
return data;
In my other function I call the returned value and the result as follows:
But when I want to call the total value of object, I got always error:
I used data.total, data['total']... but without any result

totaltotalis part ofseries, not ofdata. So it would be data[0]["total"] at best