programming-examples/js/Array/Write a JavaScript program which prints the elements of the following array..js
2019-11-15 12:59:38 +01:00

11 lines
263 B
JavaScript

// a sample 2-D array
var a = [[1, 2, 1, 24], [8, 11, 9, 4], [7, 0, 7, 27], [7, 4, 28, 14], [3, 10, 26, 7]];
for (var i in a)
{
console.log("row " + i);
for (var j in a[i])
{
console.log(" " + a[i][j]);
}
}