日期:2014-05-16 浏览次数:20479 次
function Cat(cColor){
this.color=cColor;
this.showColor=function(){
alert(this.color);
}
}
function TomCat(cColor){
Cat.call(this,cColor);
}
var tom=new TomCat("black");
tom.showColor();
function Cat(cColor){
this.color=cColor;
this.showColor=function(){
alert(this.color);
}
}
function TomCat(cColor){
Cat.apply(this,new Array(cColor));
}
var tom=new TomCat("black");
tom.showColor();function Cat(cColor){
this.color=cColor;
this.showColor=function(){
alert(this.color);
}
}
function TomCat(cColor){
Cat.apply(this,arguments);
}
var tom=new TomCat("black");
tom.showColor();