Function flatten

  • Flattens array a single level deep.

    Type Parameters

    • T

    Parameters

    • array: Many<T>[]

      The array to flatten.

    Returns T[]

    Returns the new flattened array.

    0.1.0

    flatMap, flatMapDeep, flatMapDepth, flattenDeep, flattenDepth

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