I gave up writing my "JavaScript Applications" in a closure the way you see in this tutorial. The reason is, there's no good documentation tool that will parse it. I'd much rather use namespaces to keep my code from polluting the global namespace and then I can use jsDoc.<p><pre><code> /** @namespace */
var MyApp = {}
/** My Class
* @constructor
* @param {Object} options
*/
MyApp.MyClass = function(options) {
...
};</code></pre>