Skip to content

Instantly share code, notes, and snippets.

@3200pro
Created July 26, 2022 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3200pro/b6ab7996ef0fed1be377e39e946eec20 to your computer and use it in GitHub Desktop.
Save 3200pro/b6ab7996ef0fed1be377e39e946eec20 to your computer and use it in GitHub Desktop.
Calculate the average of an array
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment