//Javascript二维数组的声明
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <script type="text/javascript"> var node=new Array(); //声明一维数组 for(var i=1; i<=9; i++){ node[i]=new Array; //声明二维数组 for(var j=1; j<=9; j++){ node[i][j]=i*j; document.write("第"+i+"&"+j+"个元素是:"+node[i][j]+"<br/>"); } } </script> </body> </html>
时间: 2024-11-11 08:16:48