I'm working on a project and using the Module Pattern pattern in the javascript itself. But during the implementation of the project I had some doubts.
1st Doubt:
Is there any difference between the two ways "Immediately-Invoked Function Expression (IIFE) "
var modulo = (function() {
//codigo
}());
var modulo = (function() {
//codigo
})();
Ben Alman, author of the article: Immediately-Invoked Function Expression (IIFE) implements the first form.
Ja Addy Osmani, author of the book: Learning JavaScript Design Patterns implements the second form.
I wonder if there is any kind of technical difference between these two forms. Or are they just two different ways to do the same thing?
2nd Doubt:
I thought it would be interesting to add sub modules within my main module. But I looked in several examples and links related to the subject and found no approach using sub modules. So I was in doubt, whether or not I should do this. Can using sub modules cause me future problems or pollute my code?