title: Javascript () operator invokes function
body: <p>I have been using javascript for a while now and am starting to realise how badly I have been using the language.  Some more advanced aspects of it are comming to light such as closures, module pattern etc.</p>
  
  <p>Can someone explain how the () operator works when placed at the end of a function i.e. why does it immediately invoke it - i havent seen this before and am puzzled as to how this actually works.</p>
  
  <p>as in:</p>
  
  <pre><code>var myFunct = function() {
      alert("here");        
  }();
  </code></pre>
  
  <p>The () at the end will immediately invoke the function.</p>