Skip to content

Instantly share code, notes, and snippets.

View thebird's full-sized avatar

Brad Birdsall thebird

  • San Francisco, CA
View GitHub Profile
@thebird
thebird / namespace.js
Created December 6, 2011 19:23 — forked from nzakas/namespace.js
A single global with a namespace method
//BSD Licensed
var YourGlobal = {
namespace: function(ns){
var parts = ns.split("."),
object = this,
i, len;
for (i=0, len=parts.length; i < len; i++) {
if (!object[parts[i]]) {