Local variable in closure changing from outside of it.This is a javascript bug or I am doing something wrong?
<p>I am using closure for privacy.
I dont understand why and how to change local variable from outside of closure.</p>

<p>I wrote a script for explain problem to you.</p>

<pre><code>var MyAjax=(function(){
  //Create a local variable for privacy
  var _opts={ 
       cache:true
   }
  ,getDefaultOptions=function(){
      return _opts
  };

  //return only getDefaultOptions function
  return { 
     getDefaultOptions:getDefaultOptions
  }
})()


//I am merging new ajax options with default options.
var defaults=MyAjax.getDefaultOptions();
var reqOptions= $.extend(defaults,{cache:false});

// I am getting expected result
console.log("extended var",reqOptions) //{cache:false}

// I am getting non expected result
// I should get {cache:true} but I am getting { cache:false }
console.log("defaults",MyAjax.getDefaultOptions()) //{cache:false} 
</code></pre>

<p>Why this happening and how ?</p>
