问答详情
源自:7-22 数组排序sort()

为什么没有输出

<!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>


提问者:慕先生5155467 2018-08-22 15:02

个回答

  • 慕粉1474350518
    2018-08-22 15:13:23
    已采纳

    输出那行最后少了个括号