Leon Gaban Leon Gaban - 9 months ago 47
Javascript Question

Why is my Ramda dropRepeats function not working here?

As you can see in my Ramda REPL link here, I am expecting the

to be dropped from the final array. However it is still there?

enter image description here

Here is the doc on R.dropRepeats

const removeRepeats = tickers => {
let cleaned = R.dropRepeats(tickers);
return R.dropRepeats(tickers);

let tickers = ['m', 'g', 'j', 'm'];

let final = removeRepeats(tickers);

console.log('final', final);


R.uniq may be the function you're after:

> R.uniq(['m', 'g', 'j', 'm'])
['m', 'g', 'j']