Skip to content

Instantly share code, notes, and snippets.

View warseph's full-sized avatar

Ezequiel Rabinovich warseph

View GitHub Profile
@warseph
warseph / gist:4337096
Created December 19, 2012 14:37
Somewhat functional javascript namespaces implementation
var namespace = function (name) {
'use strict';
var self, namespaces, i, max;
if (name.indexOf('.') >= 0) {
namespaces = name.split('.');
self = this;
for (i = 0, max = namespaces.length; i < max; i += 1) {
self = namespace.call(self, namespaces[i]);
}