how to define an array 2D in js code example
Example: js initialize 2d array
let data = [];
for (let row=0; row<rows; row++) {
data.push(new Array(cols).fill('#'));
};
let data = [];
for (let row=0; row<rows; row++) {
data.push(new Array(cols).fill('#'));
};