Answers for "find the mean of an array of numbers in javascript"

CSS
3

javascript average of numbers in array

const scores = [ 20, 50, 75, 100, 115 ];
let total = 0;

for ( let i = 0; i < scores.length; i++ ) {
  total += scores[i];
}

console.log( total / scores.length );
Posted by: Guest on September-05-2021
2

getting average of array javascript

var total = 0;
for(var i = 0; i < grades.length; i++) {
    total += grades[i];
}
var avg = total / grades.length;
Posted by: Guest on February-08-2021

Code answers related to "find the mean of an array of numbers in javascript"

Browse Popular Code Answers by Language