flattenDeep es-toolkit
Returns a new array with all depths of a nested array flattened.
Usage
flattenDeep(arr)
Use flattenDeep when you want to completely flatten a nested array, no matter how deeply nested it is. It unwinds all nested arrays within the array, creating a single flat structure.
It works identically to calling Array#flat as flat(Infinity) in the JavaScript language, but it's faster.
It completely flattens even highly complex nested structures.
Parameters
arrT[]required
The nested array to flatten.
Returns
Returns a new array with all depths flattened.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.