JS two dimensional array definition
- 2020-03-30 02:10:35
- OfStack
1. Two-dimensional array declaration is as follows:
Var images = new Array ();
// declare one dimension first
For (var I = 0; I< 10; I++) {
// one-dimensional length is 10 images[I]=new Array();
// is declaring 2 for(var j=0; J< 20; J++) {
// 2d length is 20 images[I][j]=1; }}
2. The second-level array should look like this: alert(images[0][0]);