Here's an example from the browser console
a=[[1,2,3],[3,2,1]]
b=[]
b.push(a)
a[0][0]=9
b.push(a)
In that case, I was expecting b to be
[[[1,2,3],[3,2,1]],[[9,2,3],[3,2,1]]]
But it will be
[[[9,2,3],[3,2,1]],[[9,2,3],[3,2,1]]]
I'm attaching a screenshot to better show the results in the browser: browsers console with the same code as above and output
Any ideas on why this is happening and how to get to my expecting results?