How do I declare a namespace in JavaScript?

I like this:

var yourNamespace = {

    foo: function() {
    },

    bar: function() {
    }
};

...

yourNamespace.foo();

Leave a Comment

tech