return a=b;与return 0;有什么区别?
<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>