Function insert()

← Back to Module core



Module core → insert()

Description

Insert a new element to an array at the specified index

insert(arr, index, value)


Parameters


Return Value


Usage Example

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
' )


Availability

This function is available on Dinfio version 3.2.01 or later