title: Is there a way to dynamically modify a closure of a function in JavaScript?
body: <pre><code>function a(){ return x++; }
  function b(){ var x=0; return a(); /*call a using b's scope*/ };
  console.log(b(),b(),b());
  </code></pre>
  
  <p>Desired output: 1, 2, 3</p>
  
  <p>Question: is there a way to call <code>a</code> inside <code>b</code>, forcing it to use <code>b</code>'s scope?</p>