<script >
function Polygon(iSides){
this.sides = iSides;
//alert(this.sides);
}
Polygon.prototype.getArea = function(){
return 0;
}
function Triangle(iBase,iHeight){
Polygon.call(this,3);
this.base = iBase;
this.height = iHeight;
}
Triangle.prototype = new Polygon();
Triangle.prototype.getArea = function(){
return 1* this.base * this.height;
}
var t = new Triangle(3,4);
//alert(t.sides);
alert(t.getArea());
</script>