title: JavaScript block scope vs function
body: <p>Are following snippets exactly equal? If no what is the deference?</p>
  
  <pre><code>var x = (function() {
      ... //a
      return function(){
          ... //b
      };
  })();
  </code></pre>
  
  <p>vs.</p>
  
  <pre><code>var x;
  {
      ... //a
      x = function(){
          ... //b
      };
  }
  </code></pre>