implement inheritance by object masquerading
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
<script language="javascript" type="text/javascript">
function clsA(){
this.color="red";
this.sayColor=function(){
alert(this.color);
}
this.sayColorAgain=function(){
alert(this.color);
}
}
function clsB(){
this.color="green";
//this.prox=clsA;
//this.prox();
//delete this.prox;
//clsA.call(this);
clsA.apply(this);
}
var clsb=new clsB();
clsb.sayColor();
clsb.sayColorAgain();
</