Lodash - return 每种类型之一
Lodash - return one of each type
我刚刚接触 Lodash。我确定我遗漏了什么,但是如何删除数组中的重复条目?
[0,0,0,1,1,1,2,2,2,2]
-> [0,1,2]
尝试通过_.uniq
> _.uniq([0,0,0,1,1,1,2,2,2,2])
[0, 1, 2]
我刚刚接触 Lodash。我确定我遗漏了什么,但是如何删除数组中的重复条目?
[0,0,0,1,1,1,2,2,2,2]
-> [0,1,2]
尝试通过_.uniq
> _.uniq([0,0,0,1,1,1,2,2,2,2])
[0, 1, 2]