Created
June 10, 2017 01:14
-
-
Save Daniel-Hug/f934631f9ade41124e8ca4684bb65745 to your computer and use it in GitHub Desktop.
JS function: count unique items in collection
This file contains 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 countUnique(iterable) { | |
return new Set(iterable).size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment