var a = [1,2,5,66,1,8,2,9]; //得到每不同项的两两集合的新数组
var active;
function fun(index){
let len = a.length;
while(index<len){
let flag = false;
for(let i = index+1;i<len;i++){
if(a[index] == a[i]){
flag = true;
index++;
break;
}
}
if(!flag){
return('ddd',a[index]);
}
}
}
console.log('index',fun(0));
var active;
function fun(index){
let len = a.length;
while(index<len){
let flag = false;
for(let i = index+1;i<len;i++){
if(a[index] == a[i]){
flag = true;
index++;
break;
}
}
if(!flag){
return('ddd',a[index]);
}
}
}
console.log('index',fun(0));