Created an array using:
var r = new Array(2).fill(new Array(2).fill(-1))
which looks like this:
[
[-1 -1]
[-1 -1]
]
Now want to update any one cell of this 2d array with any value like:
r[1][0] = "r";
It is updating whole column itself, which look like something like:
[
[r -1]
[r -1]
]
How we can make sure only one cell gets updated??