//数组扁平化R const arr = [1, [2, [3, [4, 5]]], 6] const flated = JSON.stringify(arr).replace(/\[|\]/g, '').split(',') console.log(flated)