How to remove all duplicates from an array of objects?
How about with some es6 magic? Reference URL A more generic solution would be: Using the above property strategy instead of JSON.stringify: You can add a wrapper if you want the propNames property to be either an array or a value: allowing both getUniqueItemsByProperties(‘a’) and getUniqueItemsByProperties([‘a’]); Stackblitz Example Explanation Start by understanding the two methods used: filter, findIndex Next take your idea of what … Read more