cara menghitung rata -rata array dalam javascript
const arrAvg = arr => arr.reduce((a,b) => a + b, 0) / arr.length
TechWhizKid
const arrAvg = arr => arr.reduce((a,b) => a + b, 0) / arr.length
var total = 0;
for(var i = 0; i < grades.length; i++) {
total += grades[i];
}
var avg = total / grades.length;