Invoke function in javascript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://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>Why following code does not work</p>

<pre><code>function func() {
    document.writeln("HELLO");
}();
</code></pre>

<p>UPDATE:<br>
Why in following example O should not use parentesis around "function{}"?</p>

<pre><code>var v = function() {
   return "HELLO";
}();
</code></pre>

<p>document.writeln(v);
​</p>
