Deviopath › JavaScript

Average of an Array

Easy · Arrays

Write a function average that returns the average of the numbers in the array, rounded to 2 decimal places (hint: Math.round(x * 100) / 100).

If the array is empty, return 0.

Next: Letter Grade