const average = (...args) => args.reduce((a, b) => a + b) / args.length;
// Example
average(1, 2, 3, 4); // 2.5
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