Function flattenDeep

  • Recursively flattens array.

    Type Parameters

    • T

    Parameters

    • array: NestedArray<T>

      The array to flatten.

    Returns FlatArray<T>[]

    Returns the new flattened array.

    3.0.0

    flatMap, flatMapDeep, flatMapDepth, flatten, flattenDepth

    flattenDeep([1, [2, [3, [4]], 5]])
    // => [1, 2, 3, 4, 5]