To extend upon this, you can also pass in references to decrease lookup time. That's why you see people doing:
(function($,window) {
//code here
})(jQuery,window); (function($,window) {
//code here
})(jQuery,window); (function(window, $, otherGlobal) {
$ = window.jQuery;
otherGlobal = window.otherGlobal;
//code here
})(window);