We have that basic jQuery
script that use wrapper code, It initialized with the transfered global window
parameter. Is it necessary transfering this parameter? window
is a global parameter and you can use it from inside function if you transfer it or not.
What is the reason for that?
(function (window, undefined) {
var jQuery = (function () {
//Define a local copy of jQuery
var jQuery = function (selector, context) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init(selector, context, rootjQuery);
},
//some code
//...
//...
//...
window.jQuery = window.$ = jQuery;
})(window);