关于数组的三行五列输出问题
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二维数组</title>
<script type="text/javascript">
Myarry=new Array();
for( i=0;i<3;i++){
Myarry[i]=new Array();
for(j=0;j<6;j++)
{Myarry[i][j]=i*j;
document.write(Myarry[i][j]+"</br>");
}
document.write(Myarry[i][j]+"</br>");
}
</script>
</head>
<body>
</body>
</html>
结果:
0
0
0
0
0
0
undefined
0
1
2
3
4
5
undefined
0
2
4
6
8
10
undefined
不用var定义就是想变成全局变量,为什么还是undefined?求告诉