I create a two-dimensional array like this:
array = new Array(3).fill([])
result is array like this [[], [], []]
Now I want to add element to have array like this [['new'], [], []]
.
I thought that array[0].push('new')
will do this, but instead it's result is: [['new'], ['new'], ['new']]
Can someone explain me why?