ychch

Results 1 comments of ychch

reduce方法 ``` const arr2 = [0, 1, 2, [[[3, 4]]]]; function _flat(arr, depth){ if( !Array.isArray(arr) || depth { if(Array.isArray(cur)){ return prev.concat(_flat(cur,depth-1)); } else { return prev.concat(cur); } },[]); } _flat(arr2,3)...