The Module Pattern:
MyPublicObject : 'a string value',
Note the comma which is used to separate JSON defined objects within the module.
This pattern does not do much except:
- Reduce the number of global variables
- Bring common functions and variables into a common namespace.
For more on Namespaces see: Create Advanced Web Applications With Object-Oriented Techniques
What’s the downside? Once we start defining things with JSON, in this pattern, we can not add private
functions or variables to the module. We can add private objects (and what Crockford calls Previlaged Objects) by invoking Closures within the Module – but that’s a topic for a later post.