1

Could someone please tell me the difference between:

(function(){}())

and

(function(){})()

I dont see any difference when I run this code.

Alex K.
  • 171,639
  • 30
  • 264
  • 288
Adarsh Kumar
  • 1,134
  • 7
  • 21
  • 1
    No difference, two syntaxes for the exact same outcome - declaring an anonymous function and executing it immediately (immediately invoked function expression - IIFE) – Adam Jenkins Oct 28 '15 at 12:41
  • This is a duplicate. I'll go find the original. – T.J. Crowder Oct 28 '15 at 12:42
  • http://stackoverflow.com/questions/3384504/location-of-parenthesis-for-auto-executing-anonymous-javascript-functions – phuzi Oct 28 '15 at 12:45
  • according to Douglas Crockford, the second version looks like dogs balls hanging off the end - so, there's that – Jaromanda X Oct 28 '15 at 12:52

0 Answers0