Possible Duplicate:
How does this JavaScript/JQuery Syntax work: (function( window, undefined ) { })(window)?
i see this pattern in the jquery source code (line 13), where they rebind 'window' and 'undefined' to locals:
(function(window, undefined) {
window.something = 42;
var dummy = 42 === undefined;
}(window));
i think rebinding 'window' to a local is a strict mode thing (prevents accidental access to window) - but look at how they are binding undefined
to a local as well. why?