Created
April 28, 2021 19:10
-
-
Save LuigiClaudio/2fce3ac945bd825b1eea8d3110669144 to your computer and use it in GitHub Desktop.
remove duplicates reduce find
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
const filteredData = mergedResults.reduce((newSet, current) => { | |
const findExisting = newSet.find((item) => item.url === current.url); | |
if (!findExisting) { | |
return newSet.concat([current]); | |
} | |
return newSet; | |
}, []); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment