Function concat

  • Concatenates an array of arrays and/or single elements into a single array

    Remarks

    This may seem redundant with a one-level flatten, but concat has a much less complex type since it doesn't have to account for deeper nesting.

    Example

    import * as A from "flurp/array";

    A.concat([[3], [6], [9, 12]]); // [3, 6, 9, 12]
    A.concat([[3], 6, [9, 12]]); // [3, 6, 9, 12]

    Type Parameters

    • T

    Parameters

    • arrays: (T | readonly T[])[]

    Returns any[]