Array insert function


insert array.

insert

(index, item)

Inserts an item into the array at the given index. All existing entries in the array are moved up one entry.

Parameters:

index - index in the array to insert the item

item - the item to insert

Returns:

This function has no return value.

Example

array.add('zero')

array.add('two')

array.add('three')

// array now contains three items. array[0] is 'zero',

// array[1] is 'two', and array[2] is 'three'.

array.insert(1, 'one')

// array now contains four items. array[0] is 'zero',

// array[1] is 'two', array[2] is 'two', and array[3] is 'three'.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*