Created
June 30, 2010 14:11
-
-
Save dcneiner/458700 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// How I normally did it: | |
(function ($) { | |
var global = { | |
// ... | |
}; | |
window.global = global; | |
}(jQuery)); | |
// What I learned from @amWirick | |
var global = (function ($) { | |
return { | |
// ... | |
}; | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment