Skip to content

Instantly share code, notes, and snippets.

@chrisvoo
Created June 8, 2020 09:51
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 chrisvoo/79e618b96bc8abad47df4dea0c86e1ff to your computer and use it in GitHub Desktop.
Save chrisvoo/79e618b96bc8abad47df4dea0c86e1ff to your computer and use it in GitHub Desktop.
Removes duplicates from an array, regardless of its depth or content
const removeDuplicatesFromArray = arr =>
[...new Set(arr.map(el => JSON.stringify(el)))].map(e => JSON.parse(e))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment