Skip to content

Instantly share code, notes, and snippets.

@LuigiClaudio
Created April 28, 2021 19:10
Show Gist options
  • Save LuigiClaudio/2fce3ac945bd825b1eea8d3110669144 to your computer and use it in GitHub Desktop.
Save LuigiClaudio/2fce3ac945bd825b1eea8d3110669144 to your computer and use it in GitHub Desktop.
remove duplicates reduce find
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