title: function passing by reference
body: <p>after I run below codes why myArray is still [2, 3, 4, 5], why it is not changed to []? </p>
  
  <pre><code>var myArray = [2, 3, 4, 5];
  function doStuff(arr) {
    arr = [];
  }
  
  doStuff(myArray);
  </code></pre>
  
  <p>However when I do below steps , myArray did change to [2, 3, 4, 5, 6]</p>
  
  <pre><code>var myArray = [2, 3, 4, 5];
  function doStuff(arr) {
    arr.push(6);
  }
  
  doStuff(myArray);
  </code></pre>
  
  <p>I am very confusing about this.</p>