//数组去重
Array.prototype.unique=function(){
var temp = {}
var newArr = []
for(var i=0; i< this.length;i++){
if(!temp.hasOwnProperty(this[i])){
temp[this[i]]=this[i]
newArr.push(this[i])
}
}
return newArr
}
js数组去重
最新推荐文章于 2024-05-17 13:52:13 发布