how to initialize 2d matrix 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('#'));
};