how to initialize a 2d array in javascript 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('#'));
};