Thursday, June 4, 2009

JavaScripting Namespacing

Best way of extending a namespace in javascript
http://www.dustindiaz.com/namespace-your-javascript/

var DED = function() {
var private_var;
function private_method() {
// do stuff here
}
return {
method_1 : function() {
// do stuff here
},
method_2 : function() {
// do stuff here
}
};
}();

No comments:

Post a Comment