I\'m currently refactoring some Javascript code we have and amongst other things I\'ve changed it to make use of the revealing module pattern. The code is looking much tidie
one way is to call it as below. Define it as it is, but do not self execute it. Ensure the prototype is an empty object and then try calling it. It works the same way, but will restore the outline and you don't need to add comments in front of every function.
var myNamespace = (function()
{
function myFunc1() {}
function myFunc2() {}
return {
name: "myNamespace",
myFunc1: myFunc1,
myFunc2: myFunc2
}
});
myNamespace.prototype = {};
myNamespace();