Possible Duplicate:
(…()) vs. (…)() in javascript closures
Is there any difference between (function(){ ... })(); and (function(){ ... }()); ?
In this example both works the same way:
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);
};