<p>Today I had a discussion with a colleague about nested functions in Javascript:</p>

<pre><code>function a() {
   function b() {
      alert('boo')
   }
   var c = 'Bound to local call object.'
   d = 'Bound to global object.'
}
</code></pre>

<p>In this example, trials point out that b is not reachable outside the body of a, much like c is. However, d is - after executing a(). Looking for the exact definition of this behaviour in the <a href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" rel="noreferrer">ECMAScript v.3 standard </a>, I didn't find the exact wording I was looking for; what Sec.13 p.71 does not say, is which object the function object created by the function declaration statement is to be bound to. Am I missing something?</p>

As I understand it, these are equivalent as far as scoping is concerned:
```
```
function a() { ... }
```
```
and
```
```
var a = function() { ... }
```
```