title: simple Javascript inheritance example
body: <p>I am trying to implement simple inheritance concept in JavaScript without using any external libraries. Here is my code.</p>
  
  <pre><code>&lt;script&gt;
      BaseClass = function () {
          this.doSomething = function () {
              console.log("base class");
          };
      };
  
      DerivedClass1 = function () {
          var bc = new BaseClass();
          bc.doSomething = function () {
              console.log("derived class");
          };
          return bc;
      };
  
      DerivedClass2 = function () {
          var bc = new BaseClass();
          return bc;
      }
  
  
      var cls1 = new DerivedClass1();
      cls1.doSomething();
  
      var cls2 = new DerivedClass2();
      cls2.doSomething();
  
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Does it fall under any known design pattern?</p>