Calculate the average of an array of numbers

PHOTO EMBED

Thu Dec 02 2021 15:42:54 GMT+0000 (Coordinated Universal Time)

Saved by @Evgeniya

const average = (...args) => args.reduce((a, b) => a + b) / args.length;
​
​
average(99, 45, 26, 7, 11, 122, 22).toFixed(2); 
​
//47.43
content_copyCOPY

https://poopcode.com/calculate-the-average-of-an-array-of-numbers-in-javascript/