ArrayPrepend

Inserts an array element at the beginning of an array and shifts the positions of the existing elements to make room.

Returns: boolean

Usage

ArrayPrepend( array, value )

Arguments

Argument Description
array
(array, required)

Name of an array

value
(any, required)

value to prepend

Examples

Add an array item on to the front of an array

someArray = [3,2,1]; 
arrayPrepend(someArray, 4);
dump(someArray);

// member function
doctorArray.prepend('Hurt');
dump(doctorArray);

See also