-数组的flat方法 var arr = [1,2,3,[4],5] let newarr = arr.flat(Infinity) console.log(newarr) // [1, 2, 3, 4, 5]