0

Possible Duplicate:
JavaScript: immediate function invocation syntax

A similar question has been asked here

there, the author asked about the difference between

(function(){})();

and

function(){}();

the purpose of the first is, among other things, to inform the reader that the function is to be immediately executed. I have also seen this version

(function(){}());

Is this the same as the above two?

Community
  • 1
  • 1
puk
  • 15,530
  • 28
  • 107
  • 187
  • 3
    See http://stackoverflow.com/questions/939386/javascript-immediate-function-invocation-syntax – KooiInc May 23 '11 at 12:48

1 Answers1

0

This variant function(){}(); will give you syntax error

bjornd
  • 21,619
  • 4
  • 53
  • 70