
Array.unshift() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
454
|
ActionScript Language Reference
Array.unshift() Method
add one or more elements to the beginning of an array
Flash 5
array.unshift(value1, value2,...valuen)
Arguments
value1, ...valuen
A list of one or more element values to be added to the beginning of array.
Returns
The new length of array.
Description
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().
Example
myList = new Array (5, 6);
myList.unshift(4); // myList becomes [4, 5, 6]
myList.unshift(7, 1); // myList becomes [7, 1, 4, 5, 6]
See Also
Array.push(), Array.shift(); “Adding Elements to an Array,” in Chapter 11
Boolean() Global Function
convert a value to the boolean datatype
Flash 5
Boolean(value)
Arguments
value An expression containing the value to be converted to a Boolean.
Returns
The result of converting value to a primitive Boolean (either true or false).
Description
The Boolean() global function converts its argument to a primitive Boolean value and
returns that converted value. The results of converting various datatypes to a primitive
Boolean are described in Table 3-3 in Chapter 3. It’s normally not necessary to use the
Boolean() function; ActionScript automatically converts values