js initializing multi dimension array code example
Example 1: js initialize 2d array
let data = [];
for (let row=0; row<rows; row++) {
data.push(new Array(cols).fill('#'));
};
Example 2: javascript define multidimensional array
var iMax = 20;
var jMax = 10;
var f = new Array();
for (i=0;i<iMax;i++) {
f[i]=new Array();
for (j=0;j<jMax;j++) {
f[i][j]=0;
}
}