Created
April 11, 2019 18:33
-
-
Save YannickLeRoux/e0e27554f861db661496e0e46f8bebe0 to your computer and use it in GitHub Desktop.
Array - Remove objects with a similar 'label' property
This file contains hidden or 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
function uniq(array) { | |
return array.filter( | |
(obj, index, self) => index === self.findIndex(el => el.label === obj.label) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment