How do I calcualte the overall average of an array like this: example array:
[[80, 90, 70], [70,80,60],[90,100,80]]
what I am trying right now
for (let i = 0; i < grades.length; i++) {
for (let y = 0; y < grades[i].length; y++) {
lastTotalScore += grades[i[y]];
lastAverageScore = lastTotalScore / grades[i].length;
overallTotalScore += lastAverageScore;
overallAverageScore = overallTotalScore / grades.length;
}
}
Thanks