var a = 0;
var b = a;
b = 9;
console.log(a); // 0; changing b does not change a.
var c = [1, 2, 3];
var d = c;
d[0] = "hi";
console.log(c); // ["hi", 2, 3]; changing d[0] also changes c[0]! Why?!
I thought "=" only assigns things to variables, however in the case of arrays, it appears that "=" makes both arrays directly linked to each other. Using "=" with integers (as an example) does not yield the same behavior. Why is this? This makes me rethink how I would make a separate storing location for an array. Are there any other sorts of similar behavior that may not be so obvious?