Created
January 7, 2022 22:38
-
-
Save rschwabco/fd4a8295386e51f07293e0e7386fcab6 to your computer and use it in GitHub Desktop.
One liner for uniqifiying an array of objects by property
This file contains hidden or 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 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