function flattern(list,depth=0){                 var res = [];                 for(var item of list){                     if(Array.isArray(item) && depth>0){                         //深度                         var child = flattern(item,depth-1);                         res = res.concat(child)                     }else{                         res.push(item);                     }                 }                 return res;             } 刚刚做了一下第二个,是这个意思吗
点赞 5

相关推荐

牛客网
牛客企业服务