效果: const arr = [1, [2, [3, [4, 5]]], 6]; // => 输出结果:[1, 2, 3, 4, 5, 6] 方法: const res1 = arr.flat(Infinity);