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 –