insert()Insert a new element to an array at the specified index
insert(arr, index, value)
arr (array) — An arrayindex (number) — The index at which the element has to be insertedvalue (any) — A value to be inserted
boolean — Always returns true
a = [1, 2, 3, 4, 5, 6]
insert(a, 0, 10)
' a is:
' array(
' [0] = 10,
' [1] = 1,
' [2] = 2,
' [3] = 3,
' [4] = 4,
' [5] = 5,
' [6] = 6
' )
This function is available on Dinfio version 3.2.01 or later