Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const removeDuplicates = (array: any[], prop: string) => {
- return array.filter((obj: any, pos: any, arr: any) => {
- return arr.map((mapObj: any) => mapObj[prop]).indexOf(obj[prop]) === pos;
- });
- };
Add Comment
Please, Sign In to add comment