What is the difference between (function(){ /* ... */ })(); and (function(){ /* ... */ }());
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8774425/vs-in-javascript-closures">(…()) vs. (…)() in javascript closures</a>  </p>
</blockquote>



<p>Is there any difference between (function(){ ... })(); and (function(){ ... }()); ?</p>

<p>In this example both works the same way:</p>

<pre><code>window.onload=function() {

    var a = (function(i){
        return "aaa" + i;
    })(1);


    var b = (function(i){
        return "bbb" + i;
    }(2));

    console.log("a: "+ a);
    console.log("b: "+ b);

};
</code></pre>
