Création d'un tableau 2D dans JS
var x = new Array(10);
for (var i = 0; i < x.length; i++) {
x[i] = new Array(3);
}
console.log(x);
Obedient Ox
var x = new Array(10);
for (var i = 0; i < x.length; i++) {
x[i] = new Array(3);
}
console.log(x);
function makeArray(w, h, val) {
var arr = [];
for(let i = 0; i < h; i++) {
arr[i] = [];
for(let j = 0; j < w; j++) {
arr[i][j] = val;
}
}
return arr;
}
var [r, c] = [5, 5];
var m = Array(r).fill().map(()=>Array(c).fill(0));
let data = [];
for (let row=0; row<rows; row++) {
data.push(new Array(cols).fill('#'));
};