Mwnci insert() Function

Syntax

insert(array, index, value)

Description

The insert() function inserts the specified value at the specified position. If the array has no content or the index specified is outside the range of the length of the array, then the function will fail.

Example

a=[]
a=push(a, 100)
println(a)
a=insert(a, 0, 200)
println(a)
// This should give an out of range error
a=insert(a, 2, "Fred")


[100]
[200, 100]
Error calling `insert` : ERROR: IndexError: Array index [2] out of range