Skip to content

Instantly share code, notes, and snippets.

@peponi
Last active October 17, 2018 12:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peponi/5a950953d9d6aff8e86ad0b436209700 to your computer and use it in GitHub Desktop.
Save peponi/5a950953d9d6aff8e86ad0b436209700 to your computer and use it in GitHub Desktop.
prevent doubeled objects in array
const getUniqueObjectArray = ({arr, compKey}) => arr.filter((el, index, self) => index === self.findIndex(item => item[compKey] === el[compKey]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment