Create a function that will take the array as an argument and return the average of the quizzes.
function averageValue(arr) {
let sum = 0
arr.map((num) => sum += num)
return sum / arr.length
}
const numbers = [2, 5, 8, 3, 4, 10, 7]
console.log(averageValue(numbers))
Comments
Leave a comment