数组排序方法
<script type="text/javascriept">
function sortNum(a,b) {
return b -a;
}
var myarr = new Array("80","16","50","6","100","1");
document.write(myarr.sort(sortNum));
</script>
为什么这个没效果啊?
<script type="text/javascriept">
function sortNum(a,b) {
return b -a;
}
var myarr = new Array("80","16","50","6","100","1");
document.write(myarr.sort(sortNum));
</script>
为什么这个没效果啊?
2015-12-12
举报