JavaScript创建二维数组(一维长度3,二维长度6),值为一维数组和二维数组索引值的积
<!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; } } //方法二: var myarray=[[0,0,0,0,0,0],[0,1,2,3,4,5],[0,2,4,6,8,10]] </script> </head> <body> <p>请问 方法二的原理是什么,搞不明白啊!!!!!好苦恼啊</p> </body> </html>