
Array.reverse() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
447
Example
myList = new Array("one", "two", "three");
trace ("Now deleting " + myList.pop()); // myList is now: ["one", "two"]
See Also
Array.push(), Array.shift(), Array.splice(); “Removing Elements from an Array,” in
Chapter 11; “The delete Operator,” in Chapter 5
Array.push() Method
add one or more elements to the end of an array
Flash 5
array.push(value1, value2,...valuen)
Arguments
value1, ...valuen
A list of one or more values to be added to the end of array.
Returns
The new length of array.
Description
The push() method appends a list of values to the end of an array as new elements.
Elements are added in the order provided. It differs from concat() in that push() modifies
the original array, whereas concat() creates a new array. It differs from unshift() in that
push() adds elements at the end of an array, not the beginning.
Example
myList = new Array (5, 6);
myList.push(7); // myList is now [5, 6, 7]
myList.push(10, 8, 9); // myList is now [5, 6, 7, 10, 8, 9]
See Also
Array.concat(), Array.pop(), Array.unshift(); “Adding Elements to an Array,” in Chapter 11
Array.reverse() Method
reverse the order of elements in an array
Flash 5
array.reverse()
Description
The reverse() method reverses the order of elements in an array, swapping the last ...