<!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++){ var myarr[i]=new Array(); for(var j=0;j<6;j++){ myarr[i][j]=i*j; document.write(myarr[i][j]+" "); } document.write("<br>"); } </script> </head> <body> </body> </html>
对var不了解,以为只是个符号,误吧myarr重新声明了数次
时间: 2024-11-07 17:59:26