![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Flash Player 5.
my_array
.shift()
None.
The first element in an array.
Method; removes the first element from an array and returns that element.
The following code creates the array myPets
and then removes the first element from the array and assigns it to the variable shifted
.
var myPets_array = ["cat", "dog", "bird", "fish"];
shifted = myPets_array.shift();
trace(shifted); // returns "cat"
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |