数值数组排序

function numcompare(a,b){
return a-b;
}
nums = new Array(30,10,200,4);
sortednums = nums.sort(numcompare);

源自《javascript 入门经典》

posted on 2008-05-07 12:31  真阿当  阅读(80)  评论(0编辑  收藏  举报