Javascript Syntax: Anonymous Self Calling Functions
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7978219/self-executing-function-doesnt-work">Self Executing function doesnt work?</a>  </p>
</blockquote>



<p>In Javascript, why does</p>

<pre><code>function() { console.log('hello'); }();
</code></pre>

<p>give an error, but</p>

<pre><code>function() { console.log('hello'); }()
</code></pre>

<p>not?</p>

<p>Edit: some answers state that both give syntax errors in Firefox, but this does not seem to be the case in either Chrome or a Node.js REPL. Additionally,</p>

<pre><code>(function() { console.log('hello'); }());
</code></pre>

<p>seems to work fine in Firefox.</p>
