toFlatArrayOutPlace

源码

https://github.com/ddzy/ts-utility-plugins/tree/master/src/ddzy/utility/array/toFlatArrayOutPlace

说明

数组扁平化(非原地算法)

用法

index.ts
const origin = [
'duan',
1998,
[
'a',
'b',
[
'c',
'd',
[
'e',
'f',
123
],
],
],
{
name: 'duan',
age: 20,
},
];
// ['duan', 1998, 'a', 'b', 'c', 'd', 'e', 'f', 123, { name: 'duan', age: 20 }]
utilityArray.toFlatArrayOutPlace(origin);