I'm just getting started on the Module Pattern in JavaScript with this article.
I'm not understanding why there's 2 parameters in the first line but only 1 argument is being passed in at the very end, window
.
(function(window, undefined) {
//some code
})(window);
Why is undefined
a parameter and where is it coming from?