Skip to content

Instantly share code, notes, and snippets.

@wildiney
Created May 4, 2022 19:51
Show Gist options
  • Save wildiney/8b2b4d5b05c60c9593088ce24f6467c5 to your computer and use it in GitHub Desktop.
Save wildiney/8b2b4d5b05c60c9593088ce24f6467c5 to your computer and use it in GitHub Desktop.
Remove duplicated entries in an json object
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