This documentation is archived and is not being maintained.

unshift Method

Inserts specified elements into the beginning of an array.

function unshift([item1 : Object [, ... [, itemN : Object]]]) : Array

Arguments

item1, ... , itemN
Optional. Elements to insert at the start of the Array.

Remarks

The unshift method inserts elements into the start of an array, so they appear in the same order in which they appear in the argument list.

Requirements

Version 5.5

See Also

shift Method

Applies To: Array Object

Show: