仅供参考
let arr =[1,2,3,[89,90,901],[3],[4],[5,6,7,8],6,[6,7,8]]
let reduceFn = (list,newArr=[])=>{
return list.reduce(function (a,b) {
if(Array.isArray(b)){
reduceFn(b,a)
}else{
a.push(b)
}
return a
},newArr)
}
let all = reduceFn(arr)
console.log(all)
// [1, 2, 3, 89, 90, 901, 3, 4, 5, 6, 7, 8, 6, 6, 7, 8]