Getting the Minimum or Maximum Element
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var scores:Array = [10, 4, 15, 8];
scores.sort(Array.NUMERIC);
trace("Minimum: " + scores[0]);
trace("Maximum: " + scores[scores.length - 1]);
}
}
}
Related examples in the same category