access to parent from a child object
<p>i am trying to figure out how the code below works. Can somebody explain what does it mean when it says " create an uber property that points to the parent's prototype object." What exactly does it mean when it says  "this.constructor.uber" points to parent's prototype? i've been scratching my head for a while now. i would be really thankful if somebody could explain what's happening in function Shape().  </p>

<pre><code>function Shape() {}
// augment prototype
Shape.prototype.name = 'shape';
Shape.prototype.toString = function () {
    var result = [];
    if (this.constructor.uber) {
        result[result.length] = this.constructor.uber.toString();
    }
    result[result.length] = this.name;
    return result.join(', ');
};


function TwoDShape() {}
// take care of inheritance
var F = function () {};
F.prototype = Shape.prototype;
TwoDShape.prototype = new F();
TwoDShape.prototype.constructor = TwoDShape;
TwoDShape.uber = Shape.prototype;
// augment prototype
TwoDShape.prototype.name = '2D shape';

function Triangle(side, height) {
    this.side = side;
    this.height = height;
}
// take care of inheritance
var F = function () {};
F.prototype = TwoDShape.prototype;
Triangle.prototype = new F();
Triangle.prototype.constructor = Triangle;
Triangle.uber = TwoDShape.prototype;
// augment prototype
Triangle.prototype.name = 'Triangle';
Triangle.prototype.getArea = function () {
    return this.side * this.height / 2;
}

var my = new Triangle(5, 10);
my.toString()
</code></pre>

<p>Output: <code>"shape,2Dshape,Triangle"</code></p>
