4 ms·
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
by euroclydon 16y ago
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.
/** @namespace */
var MyApp = {}
/** My Class
* @constructor
* @param {Object} options
*/
MyApp.MyClass = function(options) {
...
};
- MatthewPhillips 16y agoshould be: var MyApp = MyApp || {};