/namespace

ARCHIVED: namespace exercise

Primary LanguageJavaScript

Namespace exercise

Modify js/namespace.js to create a namespace() function, which should take a period-delimited string of arbitrary length and makes that namespace available globally. Example usage:

function namespace(path){
  // ...
}

namespace('app.models');
// which is synonymous to:
//
//   var app = {};
//   app.models = {};

app.models.User = function(){};

Get all of the tests to pass – you can run them by opening the local copy of index.html in your browser. Focusing on passing each test in order is recommended. The String split() method will come in handy.