Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "insertIndex"

Index

Functions

Functions

insertIndex

  • insertIndex<T>(source: T[], index: number, items?: T[]): T[]
  • Insert items into specific index of source.

    insertIndex([1, 2, 3], 0, [4, 5]) => [4, 5, 1, 2, 3]
    insertIndex([1, 2, 3], 1, [4, 5]) => [1, 4, 5, 2, 3]
    insertIndex([1, 2, 3], 2, [4, 5]) => [1, 2, 4, 5, 3]

    Type parameters

    • T

    Parameters

    • source: T[]
    • index: number
    • Default value items: T[] = []

    Returns T[]

Generated using TypeDoc