When you sort an array of numbers, the values are sorted according to the ASCII equivalents of the digits
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var scores:Array = [10, 2, 14, 5, 8, 20, 19, 6];
scores.sort( );
trace(scores); //10,14,19,2,20,5,6,8
}
}
}
Related examples in the same category