Last active
October 5, 2021 09:53
-
-
Save sayyedhammadali/e11c1199d95f88b3093aa743ee87260f to your computer and use it in GitHub Desktop.
Get the Average of an Array of Number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const average = arr => arr.reduce((a, b) => a + b) / arr.length; | |
average([21, 56, 23, 122, 67]) | |
//57.8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment