Array.prototype.unique = function(){
var arr=[],
tem={},
len = this.length;
for(var i=0;i<len;i++){
if(!temp[this[i]]){
temp[this[i]]='temp'
arr.push(this[i])
}
}
return arr
}
Array.prototype.unique = function(){
var arr=[],
tem={},
len = this.length;
for(var i=0;i<len;i++){
if(!temp[this[i]]){
temp[this[i]]='temp'
arr.push(this[i])
}
}
return arr
}
本文标题:2019-04-14 javascript 之数组去重
本文链接:https://www.haomeiwen.com/subject/aldewqtx.html
网友评论