也可以使用正则

const flat =arr=> JSON.parse(`[${JSON.stringify(arr).replace(/\[|\]/g, '')}]`)