JS 一维数组简单去重
var list = [1,2,4,7,1,2,3,9,5,3,11,20]
var temp = []
for(var i in list) {
if((temp.indexOf(list[i]) == -1)) {
temp.push(list[i])
}
}
console.log(temp)
JS 一维数组简单去重
var list = [1,2,4,7,1,2,3,9,5,3,11,20]
var temp = []
for(var i in list) {
if((temp.indexOf(list[i]) == -1)) {
temp.push(list[i])
}
}
console.log(temp)
本文标题:2020-05-26
本文链接:https://www.haomeiwen.com/subject/fzmpahtx.html
网友评论