javascript, design patterns, module pattern
// A Module Pattern
PACKAGE_NAME.M = (function () {
var privatePropertyOrMethod1 = …;
// …
var M = {};
M.publicProperty1 = …;
M.publicMethod1 = function (…) {…};
// …
return M;
}());
// Already familiar to JavaScript professionals
// (We just prefer avoiding object literals)