Sorting and Testing for Unique Values
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var aEmployees:Array = ["A", "P", "C", "H"];
if(aEmployees.sort(Array.UNIQUESORT) != 0) {
trace(aEmployees.toString());
}
else {
trace("Array has duplicate elements, and has not been sorted. ");
trace(aEmployees.toString());
}
}
}
}
// A,C,H,P
Related examples in the same category