Skip to content

Instantly share code, notes, and snippets.

@Astrochimp
Created November 1, 2018 03:30
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 Astrochimp/b8c94ea0864fe235a8f5c8a8196d9690 to your computer and use it in GitHub Desktop.
Save Astrochimp/b8c94ea0864fe235a8f5c8a8196d9690 to your computer and use it in GitHub Desktop.
const popular = arr.sort((a, b) =>
arr.filter(v => v===a).length
- arr.filter(v => v ===b).length
).pop()
@Astrochimp
Copy link
Author

Given an array of numbers, return the mean.

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