<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Array对象 </title>
<script type="text/javascript">
function sortNum(a,b) {
return b-a;
}
var myarr = new Array("80","16","50","6","100","1");
document.write(myarr.sort(sortNum)); ///////////
</script>
</head>
<body>
</body>
</html>////////标记那里调用函数为什么是sortNum而不是sortNum() 或者sortNum(a,b)???
添加回答
举报
0/150
提交
取消