Sort the array only if it contains unique elements: Array.UNIQUESORT
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var ranking:Array = [2,5,6,3,1,1,4,8,7,10,9];
var sortedRanking:Object = ranking.sort(Array.UNIQUESORT);
trace(sortedRanking);
trace(ranking);
}
}
}
0
2,5,6,3,1,1,4,8,7,10,9
Related examples in the same category