Isolating the Inheritance into a Function
<p><a href="http://jsbin.com/ifoguf/14/edit#javascript" rel="nofollow">http://jsbin.com/ifoguf/14/edit#javascript</a></p>

<p>I attempted Isolating the Inheritance Part into a Function, but when I create the object nothings is alerted, no errors are returned, so I'm stumped how to debug, and for a solution.</p>

<pre><code>function Shape(){}
// augment prototype
Shape.prototype.name = 'shape';
Shape.prototype.toString = function() {return this.name;};

function TwoDShape(){}


// augment prototype
TwoDShape.prototype.name = '2D shape';



function Triangle(side, height) {
this.side = side;
this.height = height;
}


// augment prototype
Triangle.prototype.name = 'Triangle';
Triangle.prototype.getArea = function(){return this.side * this.height / 2;};




var myTriangle = new Triangle(5, 10);

function extend(Child, Parent) {
var F = function(){};
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constructor = Child;
Child.uber = Parent.prototype;
}


extend(TwoDShape, Shape);
extend(Triangle, TwoDShape);


var myTriangle = new Triangle(5, 10);


alert(myTriangle.getArea());

alert(myTriangle.toString());

var s = new Shape();
alert(s.name);
</code></pre>

<p>TIA</p>
