Function InsertIntoArray

  • Inserts elements into an array at the specified index.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The target array.

    • index: number

      The index at which to insert the elements.

    • Rest...items: T[]

      The elements to insert into the array.

    Returns T[]

    The modified array.

    Throws an error if the index is out of bounds.

    4.2.7

    2023-11-25