What is the difference between those self-executing anonymous function (aka IIFE) implementation
<p>In many books / <a href="http://sarfraznawaz.wordpress.com/2012/01/26/javascript-self-invoking-functions/">blog posts</a> the self invoking anonymous function pattern is written like this:</p>

<pre><code>(function() {
  var foo = 'bar';
})();
</code></pre>

<p>However running a <a href="http://www.jslint.com/">JSLint</a> on this gives this error:</p>

<blockquote>
  <p>Move the invocation into the parens that contain the function.</p>
</blockquote>

<p>e.g. changing it to this works:</p>

<pre><code>(function() {
  var foo = 'bar';
}());
</code></pre>

<p><strong>Questions</strong></p>

<ol>
<li>Why is the first implementation not good enough for JSLint? What are the differences?</li>
<li>What is the preferred form? is JSLint always right?</li>
<li><em>Why does it work?</em> after all <code>function(){}()</code> throws a <code>SyntaxError: Unexpected token (</code> <br> But wrapping it with parens makes it all of a sudden work? e.g. <strong>(</strong><code>function(){}()</code><strong>)</strong> - works fine
<br>
(After all this is JavaScript, not Lisp, so what is the effect of the wrapping parens on the ohterwise syntax error?)</li>
</ol>

<p><strong>EDIT</strong>: this is somewhat of a followup to this (I would not say exact duplicate though): <a href="http://stackoverflow.com/questions/4979252/jslint-error-move-the-invocation-into-the-parens-that-contain-the-function">JSLint error: &quot;Move the invocation into the parens that contain the function&quot;</a>, so my main question is #3, why does it work at all?</p>
