Function concat

  • Creates a new array concatenating array with any additional arrays and/or values.

    Type Parameters

    • T

    Parameters

    • Rest ...arrays: T[] | T[][]
      Rest

    Returns T[]

    Returns the new concatenated array.

    Since

    5.0.0

    Example

    var array = [1];
    var other = concat(array, 2, [3], [[4]]);

    console.log(other);
    // => [1, 2, 3, [4]]

    console.log(array);
    // => [1]