Possible Duplicate:
Is there a difference between (function() {…}()); and (function() {…})();?
I have seen two slightly different ways of using the Self Executing Anonymous Function pattern.
1:
(function(){
//do stuff
}())
2:
(function(){
//do stuff
})();
Does the syntax difference have any implied effects that might not be obvious or are these two techniques exactly the same ?
They are the same. People tend to rather use the first. I also think JSLint suggests the first version. I prefer the second. It’s really up to you.