Skip to content

Instantly share code, notes, and snippets.

@mpuz
Created March 19, 2022 13:45
remove dulplicates in the array of objects by one of params
const filteredArr = arr.reduce((acc, current) => {
const x = acc.find(item => item.id === current.id);
if (!x) {
return acc.concat([current]);
} else {
return acc;
}
}, []);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment