Example of Average program using arrow function
let avg = numbers =>{ let sum = numbers.reduce((prev,current)=>prev+current); return sum/numbers.length; }; avg([1,2,3,4,5,6]); //Output : 3.5
Related