title: Do closures have to have an outer function or can it refer to just an outer scope?
body: <p>I have read the mega-thread on JavaScript closures, and there seems to be some discrepancy between the answers I have found, and was hoping I could get some further clarification.</p>
  
  <p>Some of the answers within the thread states a closure is created when an inner function references variables from an outer function.</p>
  
  <p>I found another answer that stated that this was a closure:</p>
  
  <pre><code>var a = 42;
  
  function b() { return a; }
  </code></pre>
  
  <p>Notice how there is no inner/outer function, but simply just one function. The explanation that person gave was that a closure is when a function references an outer scope.</p>
  
  <p>So my question is that is a closure created only when there are two functions (inner and outer), or when a function references an outer scope, which may or may not be a function (in this case, it simply is the top-level scope)?</p>