const arr = [5,10,15,20,25]; arr.reduce(function(x,y){ sum = x+y; mean = sum/arr.length; return sum; }, 0); console.log(mean);//15