DEV Community

Discussion on: 1 line of code: How to get the average of an array

Collapse
 
zerodragon profile image
Zero Dragon

you are missing a > to create the phat arrow to define the first function (just after arr)

const average = arr => arr.reduce((a, b) => a + b, 0) / arr.length;
Enter fullscreen mode Exit fullscreen mode
Collapse
 
martinkr profile image
Martin Krause

Thank you!
I adjusted the article.