So i want to create a chess board by doing a bidemensional array (array in array) but when i try creating it, the array comes out like [0,1] [0,2].... when i would like for it to be [[0,1,2,3...],[0,1,2,3...]...] i dont know if im making myself clear but here is the code, hopefully someone can tell me what am i doing wrong
generarTablero = (tablero) => {
for (var i = 0; i < 8; i++) {
// tablero.push([i])
for (let j = 0; j < 8; j++) {
tablero.push([i, j])
}
}
return tablero
}
generarTablero(tablero);
console.log(tablero)