js display 2d array

Solutions on MaxInterview for js display 2d array by the best coders in the world

showing results for - "js display 2d array"
Matthew
19 May 2020
1var a = [];
2a.push(["1", "2"]);
3a.push(["1", "2"]);
4a.push(["1", "2"]);
5
6for(var i = 0; i < a[i].length; i++) {
7  for(var z = 0; z < a.length; z++) {
8    console.log(a[z][i]);
9  }
10}
11