title: JavaScript Namespace Declaration
body: <p>I created a javascript class as follow:</p>
  
  <pre><code>var MyClass = (function() {
     function myprivate(param) {
        console.log(param);
     }
  
     return {
        MyPublic : function(param) {
           myprivate(param);
        }
     };
  })();
  
  MyClass.MyPublic("hello");
  </code></pre>
  
  <p>The code above is working, but my question is, how if I want to introduce namespace to that class.</p>
  
  <p>Basically I want to be able to call the class like this:</p>
  
  <pre><code>Namespace.MyClass.MyPublic("Hello World");
  </code></pre>
  
  <p>If I added Namespace.MyClass, it'll throw error "Syntax Error".
  I did try to add "window.Namespace = {}" and it doesn't work either.</p>
  
  <p>Thanks.. :)</p>