Tags and tests

This commit is contained in:
Angelos Chalaris
2018-07-18 21:02:42 +03:00
parent 03ee6f73ca
commit b129b46c0d
8 changed files with 115 additions and 1 deletions

View File

@ -7,7 +7,7 @@ The comparator function takes two arguments: the values of the two elements bein
```js
const uniqueElementsByRight = (arr, fn) =>
arr.reduce((acc, v) => {
arr.reduceRight((acc, v) => {
if (!acc.some(x => fn(v, x))) acc.push(v);
return acc;
}, []);