Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Return the average of the given array rounded down to its nearest integer.

function getAverage(marks){
  //TODO : calculate the downward rounded average of the marks array
  return Math.floor(marks.reduce((x,y) => x + y) / marks.length);
}
 
PREVIOUS NEXT
Tagged: #Return #average #array #rounded #nearest
ADD COMMENT
Topic
Name
4+3 =