3 ms·
In the browser, you have the global scope in the window object o it's pretty easy to define a construct for namespaces. I thought about the namespaces thing an
by erik14th 13y ago
In the browser, you have the global scope in the window object o it's pretty easy to define a construct for namespaces.
I thought about the namespaces thing and it sounds like a better idea than encapsulating stuff into anonymous functions so I made a little boilerplate that implement basic OOP features:
http://jsfiddle.net/L4Tcw/21/ http://jsfiddle.net/L4Tcw/21/
Only thing that I think smells a bit is having to keep a reference to 'this' of the main object.