0👍
✅
i. first add method,
ii. then calculate the average and return.
iii. finally print the totalAverage.
totalAverage(grades) {
var average = 0;
for(var i = 0; i < grades.length; i++){
average+= Number(grades[i].ggFinalgrade);
}
return average / grades.length;
},
replace {{TotalAverage }}
with {{ totalAverage( grade.group) }}
Source:stackexchange.com