title: What is meaning of "()" in this code[closure]
body: <pre><code>$(document).ready(function(){
      var dash = function(){
              return{
               bindEvents: function(){
               }
              };      
      }();
  window.methods = dash;
  methods.bindEvents();
   });
  </code></pre>
  
  <p>The above code doesnot work without "<strong>()</strong>". pls Explain why we need to use????</p>
  
  <p>and also</p>
  
  <pre><code>         return{
           bindEvents: function(){
                                 }
           };
  </code></pre>
  
  <p>is working fine. but if i align curly brace below the return statement. it throws an Error</p>
  
  <pre><code>          return
              {                  // throws an error
           bindEvents: function(){
                                 }
               };
  </code></pre>
  
  <p>pls Explain.</p>