怎么把二维数组显示出来
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;
}
}
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;
}
}
2015-11-19
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二维数组</title>
<script type="text/javascript">
var mynum=new Array();
for(var i=0;i<3;i++){
mynum[i]=new Array();
for(var j=0;j<6;j++){
mynum[i][j]=i*j;
document.write(mynum[i][j]+" ");
}
document.write("<br>");
}
</script>
</head>
<body>
</body>
</html>
举报