Write a function called calculateAverage which accepts an array of numbers. The function should return the average or mean of all numbers in the array is empty 0. code example
Example: average of an array js
const avg = arr => {
const sum = arr.reduce((acc, cur) => acc + cur);
const average = sum/arr.length;
return average;
}
console.log(avg([1, 2, 3, 7, 8]));