Consider this tiny bit of javascript code:
var a = [1, 2, 3], b = a; b[1] = 3; a; // a === [1, 3, 3] wtf!?
Why does \"a\" change when
Assigning an array does not create a new array, it's just a reference to the same array. Numbers and booleans are copied when assigned to a new variable.