May 2001
Intermediate to advanced
720 pages
23h 24m
English
Array.unshift( ) Method — add one or more elements to the beginning of an array
Flash 5
array.unshift(value1, value2,...valuen)
n
A list of one or more element values to be added to the beginning of
array.
The new length of array.
The unshift( ) method adds a series of elements
to the beginning of an array. Elements are added in the order
specified. To add elements at the end of an array, use
push( ) .
myList = new Array (5, 6); myList.unshift(4); // myList becomes [4, 5, 6] myList.unshift(7, 1); // myList becomes [7, 1, 4, 5, 6]
Array.push( ), Array.shift(
); Section 11.7 in Chapter 11
Read now
Unlock full access