function numcompare(a,b){return a-b;}nums = new Array(30,10,200,4);sortednums = nums.sort(numcompare);
源自《javascript 入门经典》