Leon Gaban Leon Gaban - 1 year ago 92
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);

Answer Source

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

> R.uniq(['m', 'g', 'j', 'm'])
['m', 'g', 'j']
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download