The following code should create an empty array that contains 7 empty arrays, effectively a 7x7 grid.
Accessing elements in nested arrays works fine, but trying to change their values changes the value of all elements in the same column (so changing [1][1] also changes [0][1], [2][1] etc.). I can't understand why.
var usage = new Array(7).fill(new Array(7).fill(0));
usage[1][1] += 1;