I have the following array (code written in Java):
String[][] a = new String[3][2]; a[0][0] = "1"; a[0][1] = "2"; a[1][0] = "1"; a[1][1] = "2"; a[2][0] = "1"; a[2][1] = "2";
and I want to print 111222, and I did it in Java by doing the following:
for (int i=0;i < a[i].length;i++){ for(int j=0;j <a.length;j++){ System.out.print(a[j][i]); } }
What is equivalent to this in JavaScript?
source share