📌  相关文章
📜  从javascript代码示例中的字符串中删除重复的字符

📅  最后修改于: 2022-03-11 15:02:12.260000             🧑  作者: Mango

代码示例3
const arr = [1, 2, [3, 4]];

// To flat single level array
arr.flat();
// is equivalent to
arr.reduce((acc, val) => acc.concat(val), []);
// [1, 2, 3, 4]

// or with decomposition syntax
const flattened = arr => [].concat(...arr);