Function flattenDeep

  • Recursively flattens array.

    Parameters

    • array: any[]

      The array to flatten.

    Returns any[]

    Returns the new flattened array.

    Since

    5.4.0

    See

    [[flatMap]],[[flatMapDeep]],[[flatMapDepth]],[[flatten]],[[flattenDepth]]

    Example

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