add uniqueElements By and ByRight

This commit is contained in:
Angelos Chalaris
2018-07-18 20:49:07 +03:00
parent b5ba3ca4b7
commit 03ee6f73ca
3 changed files with 56 additions and 2 deletions

View File

@ -19,6 +19,6 @@ filterNonUniqueBy(
{ id: 1, value: 'd' },
{ id: 0, value: 'e' },
],
(a, b) => a.id != b.id
); // [{id: 2, value: 'c'}]
(a, b) => a.id == b.id
); // [ { id: 2, value: 'c' } ]
```