Created
November 4, 2019 12:35
-
-
Save Ademking/7c24a1a0c36f015a88c3f115e6a50672 to your computer and use it in GitHub Desktop.
Remove duplicates from Array
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
// Helper function - remove duplicates from Array | |
function uniq(a) { | |
var seen = {}; | |
return a.filter(function(item) { | |
return seen.hasOwnProperty(item) ? false : (seen[item] = true); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment