Home > Web Front-end > JS Tutorial > Definition of JS two-dimensional array_javascript skills

Definition of JS two-dimensional array_javascript skills

WBOY
Release: 2016-05-16 16:57:36
Original
1346 people have browsed it

1. The way to declare a two-dimensional array 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();
//Declaring two-dimensional for(var j=0;j<20;j ){
// The two-dimensional length is 20 images[i][j]=1; } }

2. The way to use the secondary array should be like this: alert(images[0][0]);

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template