function Main(price,quantity){
this.price=price;
this.quantity=quantity;
}
Main.prototype.price;
Main.prototype.quantity;
Main.prototype.getPrice=function(){
return this.price*this.quantity;
}
function Child(price,quantity){
this.price=price;
this.quantity=quantity;
}
Child.prototype=Object.create(Main.prototype);
alert((new Child(2,6)).getPrice());