ixfx
    Preparing search index...

    Function insertAt

    • Inserts values at position index, shuffling remaining items further down and returning changed result.

      Does not modify the input array.

      const data = [ 1, 2, 3 ]

      // Inserts 20,30,40 at index 1
      Arrays.insertAt(data, 1, 20, 30, 40);

      // Yields: 1, 20, 30, 40, 2, 3

      Type Parameters

      • V

      Parameters

      • data: readonly V[] | V[]
      • index: number
      • ...values: V[]

      Returns V[]