Created
May 12, 2019 08:53
-
-
Save jangottweiss/6b501ef2c0b43f1edde0e46d9aa9ab32 to your computer and use it in GitHub Desktop.
[Array Unique / Remove Duplicates] #js #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
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