Skip to content

Instantly share code, notes, and snippets.

@oguzhancvdr
Created October 22, 2022 19:56
Show Gist options
  • Save oguzhancvdr/cf74ba8f3c89a12b6b664f7211f49210 to your computer and use it in GitHub Desktop.
Save oguzhancvdr/cf74ba8f3c89a12b6b664f7211f49210 to your computer and use it in GitHub Desktop.
const average = (arr) => arr.reduce((a, b) => a + b) / arr.length;
average([1,9,18,36]) //16
@oguzhancvdr
Copy link
Author

Calculate the mean of an array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment