Possible Duplicate:
Location of parenthesis for auto-executing anonymous JavaScript functions?
Are “(function ( ) { } ) ( )” and “(function ( ) { } ( ) )” functionally equal in JavaScript?
I have seen the javascript anonymous functions written two different ways:
(function(){
})();
and
(function(){
}());
I have always thought the top one to be correct, and had never encountered the bottom one until now. I think this probably makes no difference at all but I thought I shoud be sure. Is there any difference between the two or are both ways equivalent?