title: Simple JavaScript function with immediate invocation does not work... why?
body: <p>Can anybody explain why this works:</p>
  
  <pre><code>var sayHello = function (name) {
     alert("Hello there " + name + "!");
  }("Mike");
  </code></pre>
  
  <p>While this does not:</p>
  
  <pre><code>function sayHello (name) {
     alert("Hello there " + name + "!");
  }("Mike");
  </code></pre>
  
  <p>Mike Peat</p>