Example - Namespaces in JavaScript

Skip to end of metadata
Go to start of metadata

Introduction

To group functions and to avoid overwriting functions by defining them more than once one can use namespaces. JavaScript does not have namespaces, but a similar effect can be achieved by defining objects with functions, as shown below.

test.js
misc.js

Alternative syntax:

misc.js

Related Information

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.