If you wrap your modules in blocks (for example, anon functions), you can bind to a local name (via a parameter or "var"), and then have any arbitrary long (possibly "packed") name that you want (if you even at this moment you need global).
For example, my modules often look like:
;(function ($, $exp, other) { $(...) other.xyz() $exp.MyExportedObject = ...; })(jQuery, window, some_module.other_expression)
I use jQuery with noConflict, this is the first and the last shows that you can do this for any expression - global, required, computed, built-in, regardless ... the same βwrappingβ approach can be used to exclude everything (or almost all) "special named" global "- globals must exist at some level, however, the removal of possible conflicts is a very big victory.
user166390 Nov 10 '10 at 2:29
source share