title: function(){} and (function(){}) in javascript
body: <p>Team,</p>
  
  <p>I received syntax error when using <code>function(){}</code>, but not when <code>(function(){})</code>, why? <BR>I know <code>(function(){})</code> is still declaration '<code>(function(){})()</code>' is the expression. <BR>But why this declaration is not possible with simply <code>function(){}</code> without covering with <code>(... )</code>?</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;script&gt;
  function(){}       //**Syntax error**
  (function(){})     //Declaration
  (function(){})()   //Expression; so executed.
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>