{ "Chemistry - II": [ { "id": "9", "title": "Solid State", "quecount": 12 }, { "id": "10", "title": "Solutions", "quecount": 9 }, { "id": "11", "title": "Electrochemistry", "quecount": 8 }, { "id": "6", "title": "d and f- Block elements", "quecount": 42 } ], "Physics": [ { "id": "3", "title": "Circular Motion", "quecount": 5 } ] }
I am trying to sum the "quecount" but fail to get the result
$scope.chlist;
for (i = 0; i < $scope.chlist.length; i++)
{
total += $scope.chlist[i].quecount;
}
$scope.totque = total;
Help will be highly appreciated. Thank you..