Created
November 13, 2018 20:52
-
-
Save davidrautert/84195deb187fdd88325c1b0414346598 to your computer and use it in GitHub Desktop.
Count unique elements within any iterable
This file contains hidden or 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
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