title: Javascript Arguments object changes when changing the function argument?
body: <p>Changing the value of an argument name changes the value that is retrieved through arguments[ ] array. Why is it so ? <a href="http://jsfiddle.net/ttvgnupc/" rel="nofollow">JSFiddle! </a></p>
  
  <pre><code>var sum = 0;
  function foo(x,y) {
    if(x)
    {
      x = null;
    }
    for (var i = 0; i &lt; arguments.length; i++) {
      sum += arguments[i];
    }
    return sum;
  }
  foo(10,20,30);
  </code></pre>
  
  <p>It outputs 50 which is not the intended behavior and should outputs 60. </p>