Answers for "js display 2d array"

0

js display 2d array

var a = [];
a.push(["1", "2"]);
a.push(["1", "2"]);
a.push(["1", "2"]);

for(var i = 0; i < a[i].length; i++) {
  for(var z = 0; z < a.length; z++) {
    console.log(a[z][i]);
  }
}
Posted by: Guest on February-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language