Sorting Arrays
//sort() sorts regular, single dimension arrays.
//sortOn() sorts arrays of associative arrays based on one of the keys of the associative arrays.
//reverse() reverses the order of the elements.
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var aEmployees:Array = ["A", "P", "C", "H"];
aEmployees.sort();
trace(aEmployees.toString());
}
}
}
A,C,H,P
Related examples in the same category