const flattenDeep = arr =>
Array.isArray(arr)
? arr.reduce((a, b) => [...a, ...flattenDeep(b)], [])
: [arr];複製程式碼
const flattenDeep = arr =>
Array.isArray(arr)
? arr.reduce((a, b) => [...a, ...flattenDeep(b)], [])
: [arr];複製程式碼
const flattenDeep = arr =>
Array.isArray(arr)
? arr.reduce((a, b) => [...a, ...flattenDeep(b)], [])
: [arr];複製程式碼