问答详情
源自:3-7 二维数组

为什么输出不了?

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二维数组</title>
<script type="text/javascript">
 var myarr() = new Array();
 for(var i=0; i<3; i++){
     myarr[i]= new Array();
     for (var j=0; j<6; j++){
         myarr[i][j]= i*j;
         document.write(myarr[i][j]+"&nbsp");
     }

    document.write("<br>");

}
</script>
</head>

<body>
</body>
</html>


提问者:ekylin 2019-09-19 14:45

个回答

  • ekylin
    2019-09-23 10:39:34

    哦,谢谢

  • Ron_x
    2019-09-19 14:55:33

     var myarr() = new Array();

    去掉 myarr()括号:

    var myarr = new Array();