Should be easy question. I've recently started learning about these self-invoking functions and closures which keep private variables and it's kind of a mess in my head right now. I see people doing it in different ways, and I wonder, might this actually be the same thing?
(function(){})();
(function(){}());
As far as I understand it, the first one is a self-invoking expression of a function definition, whereas the second an expression of a self-invoking function definition. But is this correct, and what is the difference (in practice, technical or performance)? Are both of these (the same kind of) closure?
I'm an experienced programmer myself, so I would appreciate to know how this works. Thanks!