var a = (function() { return foo(bar); })();
In this case, it really is not necessary, but it is not, and it will not cause an error.
But IIF uses it several times as a module pattern :
var a = (function() { return foo(bar); })();
In this case, IIF is simply a module that exports something outside.
Pinal Feb 03 '14 at 13:08 2014-02-03 13:08
source share