title: Define a class with namespace in Javascript
body: <p>Refer to <a href="https://stackoverflow.com/a/387733/418439">https://stackoverflow.com/a/387733/418439</a>, </p>
  
  <pre><code>// Define a class like this
  function Person(name, gender){
  
     // Add object properties like this
     this.name = name;
     this.gender = gender;
  }
  
  // Add methods like this.  All Person objects will be able to invoke this
  Person.prototype.speak = function(){
      alert("Howdy, my name is" + this.name);
  }
  
  // Instantiate new objects with 'new'
  var person = new Person("Bob", "M");
  
  // Invoke methods like this
  person.speak(); // alerts "Howdy, my name is Bob"
  </code></pre>
  
  <p>How to define <a href="https://stackoverflow.com/questions/881515/javascript-namespace-declaration">namespace</a> as well?</p>