Za: http://www.adequatelygood.com/Debugging-Closures-and-Modules.html
var foo = (function () { var privateVar = 10; return { publicFunc: function () {/*...*/}, debug: function () { //a clever way for debugging inside functions debugger; } }; }()); foo.debug();