Skip to content

Instantly share code, notes, and snippets.

String.prototype.namespace = function(properties) {
var ns = this.split('.'),
o = window,
i,
len;
for (i = 0,len = ns.length; i < len; i++) {
o = o[ns[i]] = o[ns[i]] || {};
}
for (prop in properties) {