insertElement

Inserts an array into another array, at a provided index

No range checks are done, so an IndexOutOfBounds may occur

  1. T[] insertElement(T[] dat, T[] toInsert, uinteger pos)
    T[]
    insertElement
    (
    T
    )
  2. T[] insertElement(T[] dat, T toInsert, uinteger pos)

Return Value

Type: T[]

the modified array

Examples

assert([0, 2].insertElement([1, 1], 1) == [0, 1, 1, 2]);
assert([2].insertElement([0, 1], 0) == [0, 1, 2]);

Meta