title: Different ways of creating javascript prototype inheritance chain
body: <pre><code>function Parent(parentName){
    this.name = parentName;
  }
  
  Parent.prototype.printName = function(){
    console.log(this.name);
  }
  
  var p = new Parent("Parent");
  console.log(p);
  
  function Child(parentName, childName){
    Parent.call(this, parentName);
    this.name = childName; 
  }
  
  1. Child.prototype = Object.create(Parent.prototype);
  2. Child.prototype = Parent.prototype;
  
  var c = new Child("Parent","Child");
  console.log(c);
  </code></pre>
  
  <p>Can someone tell me the difference between the above statements 1 &amp; 2. In either way child object is able to call c.printName();</p>