DEV Community

Discussion on: newbie question help

Collapse
 
montanacoder profile image
Jeremy

function avgValue (array=[]){
let sum = 0;
array.forEach(number => {
sum += number;
})
return sum/array.length
}