title: Prototypical object inheritance in javascript
body: <p>So I have this example that I have created and I have a question about why my child object is behaving the way it is. I am creating a Cat object and creating an instance of that object names Kat. I am then using the object() method below to extend Kat to create an object called Poe . </p>
  
  <pre><code>function object(o) {
      function f() {};
      f.prototype = o;
      return new f();
  }
  </code></pre>
  
  <p>My question is why does Poe seem to share private instance var and methods with Kat, even when Poe's public vars have been overwritten? Also, these public methods work fine with the prototype public methods.</p>
  
  <p><a href="http://jsfiddle.net/ka_tee_jean/5aPT2/" rel="nofollow">http://jsfiddle.net/ka_tee_jean/5aPT2/</a></p>