Skip to content

Instantly share code, notes, and snippets.

@Ademking
Created November 4, 2019 12:35
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 Ademking/7c24a1a0c36f015a88c3f115e6a50672 to your computer and use it in GitHub Desktop.
Save Ademking/7c24a1a0c36f015a88c3f115e6a50672 to your computer and use it in GitHub Desktop.
Remove duplicates from Array
// 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