title: JavaScript pass scope to another function
body: <p>Is it possible to somehow pass the scope of a function to another?</p>
  
  <p>For example,</p>
  
  <pre><code>function a(){
     var x = 5;
     var obj = {..};
     b(&lt;my-scope&gt;);
  }
  
  function b(){
     //access x or obj....
  }
  </code></pre>
  
  <p>I would rather access the variables directly, i.e., not using anything like <code>this.a</code> or <code>this.obj</code>, but just use <code>x</code> or <code>obj</code> directly.</p>