I found such two code and not understand the difference between them if any exists.
Can you explain me what is difference between code preventing global scope polution.
First:
(function() {
var x = 1;
// thousand of lines here
}(window));
Second:
(function() {
var x = 1;
// thousand of lines here
})(window);
Question can be trivial but I am not understand difference what is doing ();
- can you explain it?