Skip to content

Instantly share code, notes, and snippets.

View romuleald's full-sized avatar
🥳

Antoine Sanchez romuleald

🥳
View GitHub Profile
@nzakas
nzakas / namespace.js
Created December 6, 2011 19:14
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]]) {