The jQuery source is wrapped in closure, for example:
(function(window, undefined) { //awesome jQuery library code in here })(window);
I do not understand why one of these parameters is needed.
Since window is a global variable, why should it be passed? What is the purpose of passing in a global parameter and accessing it inside a closure with the same name?
What is the parameter undefined for? Why is no value passed?
source share