Array values not being changed by method
<p>not a js expert so this might be a stupid question but...</p>

<p>Why does the log show that the array has changed? I was expecting the array still to be a [0,0] since the method is invoked after the console.log. Also, if I try to replace the whole array like this: </p>

<pre><code>this.my_array = [1,0];
</code></pre>

<p>the log will still show [0,0], which is something that makes more sense to me. 
What's going on?</p>

<pre><code>function Y() {        
  this.my_array = [0,0];            
  this.changeIt = function() {
    this.my_array[0] = 1;
  };
}

var z = new Y;
console.log(z.my_array);
z.changeIt();
</code></pre>

<p>​</p>
