I am trying to do this basic iteration and object initialization but it seems like every row is being created with the object containing same ids. Am I getting crazy?
function makeGrid (cols, rows) {
const grid = new Array(cols).fill(new Array(rows))
for (let i = 0; i < cols; i++) {
for (let j = 0; j < rows; j++) {
grid[i][j] = {id: random()}
}
}
return grid
}

.fill(new Array(rows))this is your problem. Use e.g..fill().map(_ => new Array(rows));