拍平数组 [1, [2, [3, [4, 5]]], 6] => [1, 2, 3, 4, 5, 6] 方法1:直接调用已有flat函数 let arr = [1, [2, [3, [4, 5]]], 6]; let arr_flat = arr.flat(Infinity)