Created
January 6, 2012 08:11
-
-
Save psiborg/1569628 to your computer and use it in GitHub Desktop.
JS Namespace
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
var RIM = RIM || {}; | |
RIM.com = RIM.com || {}; | |
RIM.com.alice = RIM.com.alice || {}; | |
RIM.com.alice.hello = function () { | |
console.log('Hello World!'); | |
}; | |
(function() { | |
// save a local reference to namespace objects | |
var R = window.RIM; | |
var alice = R.com.alice; | |
alice.hello(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment