Last active
December 18, 2015 02:29
-
-
Save ashanbh/5711288 to your computer and use it in GitHub Desktop.
Yahoo namespace function
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
YAHOO.namespace = function() { | |
var a=arguments, o=null, i, j, d; | |
for (i=0; i<a .length; i=i+1) { | |
d=a[i].split("."); | |
o=YAHOO; // YAHOO is implied, so it is ignored if it is included | |
for (j=(d[0] == "YAHOO") ? 1 : 0; j<d.length; j=j+1) { | |
o[d[j]]=o[d[j]] || {}; | |
o=o[d[j]]; | |
} | |
} | |
return o; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment