Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

getting average of array javascript

var total = 0;
for(var i = 0; i < grades.length; i++) {
    total += grades[i];
}
var avg = total / grades.length;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #average #array #javascript
ADD COMMENT
Topic
Name
7+2 =