var game_board = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
];
(function plot() {
game_board.forEach((element, i) => {
element.forEach((value, j) => {
// access i here
console.log(j);
});
});
})()
I have a multidimensional array and I want to access both indexes i and j.
// access i hereyou should be able to accessithere. Tryconsole.log(i, j)and you'll see both indexesi?