javascript sort() 用法(排序)
var ne = new Array(1, 5, 2, 90, 40);
function nubmerorder(a, b) {
return a - b;
}
alert(ne.sort());
alert(ne.sort(nubmerorder));
alert(ne.sort(nubmerorder).reverse());
function nubmerorder(a, b) {
return a - b;
}
alert(ne.sort());
alert(ne.sort(nubmerorder));
alert(ne.sort(nubmerorder).reverse());