How To Calculate Average or Mean From A Set Of Numbers

Using an Arrow function, you can easily calculate the mean (average) from a set of numbers in Javascript using the reduce() method.

To achieve this, we have to add up the numbers in the set, then divide the result with the number of elements in the set.

Check out the cover image for implementation

 


Simon Ugorji

16 Blog posts

Comments