fill with a literal stores the same row in every slot.
Acceptance criteria
- 1.#out should show rows independent.
fill with a literal stores the same row in every slot.
const grid = new Array(2).fill(new Array(2).fill(0)); grid[0][0] = 1; document.querySelector('#out').textContent = grid[1][0] === 0 ? "rows independent" : "rows shared";
Output ready when you are
Press Run to render your code, or Submit to validate your solution.