<script type="text/javascript">
function sortNum(a,b) {
return 0;//输出结果为:80,16,50,6,100,1
return a=b;//输出结果为:1,100,6,50,16,80
}
var myarr = new Array("80","16","50","6","100","1");
document.write(myarr.sort(sortNum));
</script>
从结果上看:return 0;数组排序不变;
return a=b;数组反转