Skip to content

Instantly share code, notes, and snippets.

@chrisvoo
Created June 8, 2020 09:51
Show Gist options
  • 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