我已在最后一行以下参考父类的构造属性在儿童构造在JavaScript
function mild_bird(){
this.name = "catherine";
this.origin = "st petersburg";
this.location = "brighton beach";
}
mild_bird.prototype.get_info = function(){
return "poo" + ", " + "pee";
}
function wild_bird(nickname){
this.nickname = nickname;
//anyway to reference parameters in mild_bird constructor's?
this.name = mild_bird.prototype.name;
this.origin = mild_bird.prototype.origin;
this.location = mild_bird.prototype.location;
}
wild_bird.prototype = new mild_bird();
wild_bird.prototype.constructor = wild_bird;
var the_wild_bird = new wild_bird("sandy");
alert(the_wild_bird.name);
警报返回undefined。我希望它返回“凯瑟琳”。是否有可能在mild_bird的构造函数中将属性传递给wild_bird的构造函数?