What's the best way to create a JavaScript namespace? -


I have not found any common way on the internet to create a namespace in Javascript.

What's the best way to create a namespace (and please list any dualals that can be a special approach).

  (function () {var useful variable; var foo = {time: function} ( Leak ('Hi')}};  

Only foo is in contact with the global namespace (global namespace window.foo = foo; And it works in the name of the "anon function" namespace within your personal self.


Comments