This is an old blog. My new blog is moved here.

JavaScript Namespace using returned object

1/26/2010

This is another cool way to create a namespace wrapper that I have seen today. Kind of reminds the of the module patter.

var NameSpace = (typeof (NameSpace) === "object") ? NameSpace : (function() {

var b = {
method1: function() {

},
method2: function() {

}
}

return b
})();

Responses to The JavaScript Namespace using returned object