Last active
August 15, 2019 18:15
-
-
Save artemhp/badabd55c9df2499a25819520aa8a7c1 to your computer and use it in GitHub Desktop.
IIFE. Exposing public variables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( global, factory ) { | |
if ( typeof module === "object" ) { | |
module.exports = | |
global.document ? | |
factory( global, true ) : | |
function( w ) { | |
if ( !w.document ) { | |
throw new Error( "jQuery requires a window" ); | |
} | |
return factory( w ); | |
}; | |
} else { | |
factory( global ); | |
} | |
} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { | |
jQuery = {}; | |
if ( !noGlobal ) { | |
window.jQuery = window.$ = jQuery; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment