title: Need to understand Javascript Parasitic Inheritance
body: <p>Need to understand what Parasitic Inheritance actually does.</p>
  
  <p>I referred this link : <a href="http://javascriptexample.net/useobject23.php" rel="nofollow">Parasitic Inheritance in javascript</a></p>
  
  <p>I need to understand what this example does :</p>
  
  <pre><code>Shape = {name: 'Shape'};
  Shape.prototype.toString = function()
  {
    return this.name;
  };
  
  function Rectangle(width, height) {
     var rect;
     P = function() {};
     P.prototype = Shape;
     rect = new P();
     rect.width = width;
     rect.height = height;
     return rect;
  }
  </code></pre>
  
  <p>Second example works fine, but I need to know "<strong>Where does Parasitic inheritance come into picture ?</strong>"</p>
  
  <pre><code>var Person = function(name, age) 
  {
    this.name = name;
    this.age = age;
  };
  
  var Employee = function(name, age, group) 
  {
    var e = new Person(name, age);
    e.group = group;
    return e;
  };
  
  var testname= new Employee('ABC', 30, 'Developer');
  </code></pre>
  
  <p>Thanks.</p>