let arr = [[3,5,3],[3,5],[0,23],[9,29,1]];
let newArr = [];
function unique(arr) {
for(var i=0;i<arr.length;i++) {
if(Array.isArray(arr[i])) {
unique(arr[i])
console.log(1)
}else {
if(newArr.indexOf(arr[i]) == -1){
newArr.push(arr[i]);
}
}
}
return newArr;
}
unique(arr);
08-18
215
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)