title: Can I change a function referenced in a Javascript closure in an anonymous scope
body: <p>Given this example:</p>
  
  <pre><code>var x = function() { return(0); };
  var y = function() { return(x()); };
  </code></pre>
  
  <p>Calling y() in the console will return 0. Changing x() in this scope will change the value returned by y(). This is possible because I have direct access to the scope of y(). However, if y() was defined in an anonymous scope, but I have access to it, but do not have direct access to x(), can I change x() to be something like:</p>
  
  <pre><code>var x = function() { return(1); };
  </code></pre>
  
  <p>So that calling y() will reflect this change to x()?</p>
  
  <p>In other words, given access only to y(), can I grab it's scope and change x() so that calling y() will reflect that change?</p>