I am trying to append some values to a particular array in an array of arrays, like this:
a1 = [[]] * 2
a1[0] << -1
a1 # => [[-1], [-1]]
a2 = [[], []]
a2[0] << -1
a2 # => [[-1], []]
[[]] * 2 == [[], []] # => true
a2 has the expected value while a1 seems to be wrong. What I was expecting is a1 to have the value [[-1], []] since I changed a1[0] & not a1[1].