Created
February 10, 2013 17:48
-
-
Save johnstew/4750398 to your computer and use it in GitHub Desktop.
JavaScript Namespace to avoid object/method collisions with other libs.
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
if(!com_yourname) | |
com_yourname = {}; | |
else if (typeof (com_yourname) != "object") | |
throw new Error("com_yourname is not an object"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment