Skip to content

Instantly share code, notes, and snippets.

@davidrautert
Created November 13, 2018 20:52
Show Gist options
  • Save davidrautert/84195deb187fdd88325c1b0414346598 to your computer and use it in GitHub Desktop.
Save davidrautert/84195deb187fdd88325c1b0414346598 to your computer and use it in GitHub Desktop.
Count unique elements within any iterable
function unique(iterable) {
return new Set(iterable).size;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment