/**
* 数组去重方法
*/
Array.prototype.unique = function(){
var res = [],
json = {};
for(var i=0, len=this.length; i<len; i++){
var data = this[i];
if(!json[data]){
res.push(data);
json[data] = true;
}
}
return res;
};
Js数组去重方法
最新推荐文章于 2024-06-01 07:27:22 发布