Skip to content

Instantly share code, notes, and snippets.

@YannickLeRoux
Created April 11, 2019 18:33
Show Gist options
  • Save YannickLeRoux/e0e27554f861db661496e0e46f8bebe0 to your computer and use it in GitHub Desktop.
Save YannickLeRoux/e0e27554f861db661496e0e46f8bebe0 to your computer and use it in GitHub Desktop.
Array - Remove objects with a similar 'label' property
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