Skip to content

Instantly share code, notes, and snippets.

@rschwabco
Created January 7, 2022 22:38
Show Gist options
  • Save rschwabco/fd4a8295386e51f07293e0e7386fcab6 to your computer and use it in GitHub Desktop.
Save rschwabco/fd4a8295386e51f07293e0e7386fcab6 to your computer and use it in GitHub Desktop.
One liner for uniqifiying an array of objects by property
const uniqueObjectArray = [...new Map(objectArray.map((item) => [item["id"], item])).values()];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment