Created
May 4, 2022 19:51
-
-
Save wildiney/8b2b4d5b05c60c9593088ce24f6467c5 to your computer and use it in GitHub Desktop.
Remove duplicated entries in an json object
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
function makeUnique(object){ | |
jsonObject = object.map(JSON.stringify) | |
const uniqueSet = new Set(jsonObject) | |
const uniqueArray = Array.from(uniqueSet).map(JSON.parse) | |
return uniqueArray | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment