title: round brackets javascript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/440739/what-do-parentheses-surrounding-a-javascript-object-function-class-declaration-m">What do parentheses surrounding a JavaScript object/function/class declaration mean?</a>  </p>
  </blockquote>
  
  
  
  <p>What's the meaning of round brackets in JS when used as follow:</p>
  
  <pre><code>&lt;script&gt;
  (
   function foo(){ alert("Hello world!")}()
  )
  &lt;/script&gt;
  </code></pre>
  
  <p>It works as expected and shows "Hello world!". But if I pull off the brackets</p>
  
  <pre><code> &lt;script&gt;
  
   function foo(){ alert("Hello world!")}()
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Chrome console generates the error "Uncaught SyntaxError: Unexpected token ) ".
  I can't figure out why does this happen...any help?</p>