While working on a basic game of life simulation, I encountered an unusual problem. I have a 2D array and I'm attempting to modify a single value at coordinates x,y. Sounds simple enough, right?
let arr = new Array(10).fill(new Array(10).fill(1))
arr[1][1] = 0
console.log(arr[3])
I've successfully done this in previous projects, but for some reason now it's affecting all values in arr[x][1] instead of just arr[1][1]