- Preparing search index...
- The search index is not available
atomic-fns
- flatten<T>(arr: T[], depth?: number | boolean): T[]
-
Parameters
-
arr: T[]
-
Optional
depth: number | boolean
Returns T[]
- flatten<T>(arr: Object, depth?: number | boolean): Object
-
Parameters
-
arr: Object
-
Optional
depth: number | boolean
Returns Object
Flattens an array or object. Arrays will be flattened recursively up to
depth
times. Objects will be flattened recursively.Example
Returns
The new flattened array or object.
See
Array.flat()