title: using create vs prototype in Javascript
body: <p>I am new to JS.</p>
  
  <p>I was experimenting in JSFiddle.</p>
  
  <p>I have created an object A and then I have created two new Objects B and C like below.</p>
  
  <pre><code>debugger;
  var A = {
      name:"h",
      lastname:'n',
      address:'B'
  };
  A.getname = function()
  {
      console.log(this.name);
  };
  var B = Object.create(A);
  var C=new Object();
  C.prototype = A;
  console.log(B.lastname);
  console.log(C.lastname);
  A.getname();
  B.getname();
  C.getname();
  </code></pre>
  
  <p>I have taken the concept of creating a new object with already existing object using Object.create(old object) from javascript:Good Parts book and the concept of inheriting object from <a href="http://www.codecademy.com/courses/objects-ii/3/3?curriculum_id=506324b3a7dffd00020bf661" rel="nofollow">http://www.codecademy.com/courses/objects-ii/3/3?curriculum_id=506324b3a7dffd00020bf661</a> .</p>
  
  <p>After debugging,
  But I the value console.log(C.lastname) is undefined and C.getname() is giving me error.</p>
  
  <pre><code>TypeError: C.getname is not a function
  </code></pre>
  
  <p>Why is it throwing me error and what are the advantages of using Object.create() in this case.</p>