0
正如你可以在我的Ramda REPL link here看到的,我期待m
从最终阵列中删除。但它仍然存在?为什么我的Ramda dropRepeats函数在这里不起作用?
const removeRepeats = tickers => {
console.log('removeRepeats',tickers);
let cleaned = R.dropRepeats(tickers);
console.log('cleaned',cleaned);
return R.dropRepeats(tickers);
};
let tickers = ['m', 'g', 'j', 'm'];
let final = removeRepeats(tickers);
console.log('final', final);
的文件说,“返回,没有任何一个新的列表连续重复的元素“,那些'm's不是连续的... – ewcz
大声笑这是跛脚......嗯,我想我需要继续寻找另一种方法来完成这些框架之一。 –
@ewcz你想发布你的答案?顺便说一句我在这里找到了lodash解决方案:https://lodash.com/docs/4.16.1#uniq –