前端 - javascript怎么实现多种数据类型的数组去重?
怪我咯
怪我咯 2017-04-10 15:05:26
0
1
241

数组中包含数组,Object,undefined,null,function等等一系列复合类型,请问javascript怎么实现去重。

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
PHPzhong

看一下underscore的uniq()方法实现

文档:
http://underscorejs.org/#uniq

代码:
https://github.com/jashkenas/underscore/blob/master/underscore.js#L521

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!