var arr = [1,2,3,4,5,6,1,6,7,2];
var newArr = [];
for(var i =0;i<arr.length-1;i++){
if(newArr.indexOf(arr[i]) == -1){
newArr.push(arr[i]);
}
}
时间: 2024-10-03 14:41:44
var arr = [1,2,3,4,5,6,1,6,7,2];
var newArr = [];
for(var i =0;i<arr.length-1;i++){
if(newArr.indexOf(arr[i]) == -1){
newArr.push(arr[i]);
}
}