title: Issues with Javascript inheritance & base class prototype
body: <p>I'm facing issues with configuring object while inheriting 
  So I've </p>
  
  <pre><code>baseclass.prototype.activity =function(){ console.log("Im"+activity); }
  </code></pre>
  
  <p>and multiple other objects inheriting the base class(say A and B).</p>
  
  <p>I want to configure run based on type of A and B
  So if it is A then calling run should make activity as Running and similarly with B it can be swimming 
  I'm using following factory method for creating A and B depending on their type</p>
  
  <pre><code>activityFactoryObject.prototype.makeObj = Object.create(baseclass);
  activityFactoryObject.prototype.createObject = function (config) {
  
      switch (config) {
      case "running":
  
          this.makeObj = A;
          break;
      case "swimming":
  
          this.makeObj = B;
  
          break;
      }
      this.makeObj.prototype = baseclass.prototype;  
      return new this.makeObj(config); 
  
  };
  </code></pre>