Skip to content

Instantly share code, notes, and snippets.

@OlivierJM
Created December 5, 2021 17:55
Show Gist options
  • Save OlivierJM/12f4d9826cb537f782defac4707480dd to your computer and use it in GitHub Desktop.
Save OlivierJM/12f4d9826cb537f782defac4707480dd to your computer and use it in GitHub Desktop.
function removeDuplicates(arr, prop){
return arr.filter((obj, index, self) => {
return index === self.findIndex((t) => {
return t[prop] === obj[prop]
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment