JAVASCRIPT
Namespaces
Article by:Geoffrey Hunter
Date Published: | |
Last Modified: |
Contents
Overview
Unlike many object-orientated languages such as C++ and C#, namespaces are not natively supported in JavaScript.
However, they can be “faked” in a number of different ways. One of the easiest is to enclose everything within a variable:
|
|
Notice though, you have to remember to include commas after every function or variable declaration. AND, you can’t declare private objects. But it is the simplest solution.
Authors

This work is licensed under a Creative Commons Attribution 4.0 International License .