(function($,window,undefined){
...
})(jQuery,this)
I often see codes like above. I understand it passes jQuery to the anonymous function as $ so inside it jQuery can be referred to by $. But what is the purpose for passing window while window is a global variable which you can call anywhere? And why define an undefined parameter while its not being used at all?