1. The two-dimensional array declaration method is the following varimagesnewArray (); // declare a dimension for (vari0; I & lt; 10; I ++) {// the length of one dimension is 10 images [I] newArray (); // declare two-dimensional for (varj0; j & lt; 20; j ++) {// the two-dimensional length is 20i... syn
1. The two-dimensional array declaration method is as follows:
Var images = new Array (); // declare a dimension first
For (var I = 0; I <10; I ++) {// One-dimensional length is 10
Images [I] = new Array (); // declare a two-dimensional
For (var j = 0; j <20; j ++) {// the two-dimensional length is 20
Images [I] [j] = 1;
}
}
2. The second-level array of www.2cto.com should be used like this.
Alert (images [0] [0]); it is really troublesome to declare. first declare the first dimension, and then generate the second dimension cyclically.
From Xu Yue's column