title: javascript pseudo classical inheritance and prototypal inheritance example confusion
body: <p>I did not really understand difference between pseudo classical &amp; Prototypal Inheritance. Have a look at below code snippet. </p>
  
  <p>Prototypal : I am able to understand this code (Douglas Crockford). I have 
  changed the class names &amp; added implementation for better understanding since his code blocks are incomplete in presentaiton. </p>
  
  <pre><code>var baseObject = {
      a : "old",
      firstMethod: function () {alert("First method");},
      secondMethod: function () {alert("Second method");}
  };
  var derivedObject = Object(baseObject);
  alert(derivedObject.a);
  
  derivedObject.thirdMethod = function () {alert("Third method");};
  var derivedChildObject = Object(derivedObject);
  
  derivedChildObject.firstMethod();
  derivedChildObject.secondMethod();
  derivedChildObject.thirdMethod();
  </code></pre>
  
  <p>Pseudo classical:</p>
  
  <p>Since I did not get clarity from same code snippet in his presentation as methods are incomplete, I went to some other link in internet</p>
  
  <p><a href="http://javascript.info/tutorial/pseudo-classical-pattern" rel="nofollow">http://javascript.info/tutorial/pseudo-classical-pattern</a></p>
  
  <pre><code>function Animal(name) {
    this.name = name
  }
  
  Animal.prototype = {
    canWalk: true,
    sit: function() {
      this.canWalk = false
      alert(this.name + ' sits down.')
    }
  }
  
  var animal = new Animal('Pet') // (1)
  
  alert(animal.canWalk) // true
  
  animal.sit()             // (2)
  
  alert(animal.canWalk) // false
  </code></pre>
  
  <p>The scheme for a pseudo-class:</p>
  
  <p>Methods and default properties are in prototype.
  Methods in prototype use this, which is the current object because the value of this only depend on the calling context, so animal.sit() would set this to animal.</p>
  
  <p>Can you help me in providing right example?  You can take - Either Animal use case Or baseObject use case for reference Or come up with your own example</p>