Skip to content

Instantly share code, notes, and snippets.

@asleepwalker
Created April 19, 2016 23:37
Show Gist options
  • Save asleepwalker/8c54827b403e0d7454a15bf5ef0c8644 to your computer and use it in GitHub Desktop.
Save asleepwalker/8c54827b403e0d7454a15bf5ef0c8644 to your computer and use it in GitHub Desktop.
Remove duplicates from JavaScript array
var unique = arr.filter(function(item, index) {
return arr.indexOf(item) == index;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment