Skip to content

Instantly share code, notes, and snippets.

@jangottweiss
Created May 12, 2019 08:53
Show Gist options
  • Save jangottweiss/6b501ef2c0b43f1edde0e46d9aa9ab32 to your computer and use it in GitHub Desktop.
Save jangottweiss/6b501ef2c0b43f1edde0e46d9aa9ab32 to your computer and use it in GitHub Desktop.
[Array Unique / Remove Duplicates] #js #array
var arr = ['a', 1, 'a', 2, '1'];
// returns ['a', 1, 2, '1']
arr.filter((value, index, self) => {
return self.indexOf(value) === index;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment