Created
June 8, 2020 09:51
-
-
Save chrisvoo/79e618b96bc8abad47df4dea0c86e1ff to your computer and use it in GitHub Desktop.
Removes duplicates from an array, regardless of its depth or content
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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