Hopefully this will help with some of the namespacing pains, JavaScript does not have native namespaces but it does have JSON objects that is the next best thing. Some advantages:
- Allowing complex structured JavaScript facilitates navigation in IDE (Go to definition)
- Scoping in namespaces allows easier browsing and debugging in browser (Predictive text)
A normal namespace implementation
What is the advantage of using this namespacing library?
- Easily create namespace chain with dotted notation
- Flexible ordering (E.g. Create level 3 then define level 2)
- Merging of namespace content on multiple declaration
Feel free to download and use (No guarantees but suggestions or bug feedback welcome).
Examples creating namespaces using this library: