Access the last element of theArray: theArray[theArray.length - 1]
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var cities:Array = ["Toronto", "Montreal", "Vancouver", "Waterloo"];
trace(cities); // Toronto,Montreal,Vancouver,Waterloo
}
}
}
Related examples in the same category