Scope Chain and [[Scope]] in javascript
<pre><code>var currentScope = 0;
(function(){
    var currentScope = 1, one= 'scope1';
    alert(currentScope);
  (function(){
    var currentScope = 2, two= 'scope2';
    alert(currentScope);
    alert(one + two);
  })();
})();
</code></pre>

<p>Now when i execute this code in jsbin, i get the alert as <code>1 then 2</code> and then <code>scope 1 and scope 2</code>. But i came to know that in <code>ExecutionContext</code>, it will actually call the inner function first which will look for the <code>outer variable</code> then so on.</p>

<ol>
<li>Can anyone tell me how the <code>ExecutionContext Object</code> would look like in my function environment.</li>
<li>Correct me if i am wrong, in the browser it would first display the currentScope 1 first, then the CurrentScope 2. But actually behind the scenes in interpreter, it happens vice-versa.</li>
</ol>
