Created
August 24, 2018 01:30
-
-
Save leslie-alldridge/2ea3c56c3d29fec7823e803d23004e71 to your computer and use it in GitHub Desktop.
object single item only
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 obj = faves.reduce((acc, entry, i, arr) => { | |
if (!acc.hasOwnProperty(entry.id)) acc[entry.id] = entry | |
return acc | |
}, {}) | |
const noDupes = Object.keys(obj).map(key => obj[key]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
change faves. to whatever array you're using