请老师检查是否正确
来源:6-4 编程练习
慕斯558859
2019-03-14 20:08:06
function animal(specise, num) {
this.specise = specise;
this.num = num;
}
function cat() {};
cat.prototype = new animal("猫", 20)
cat.prototype.info = function() {
alert("动物名称:" + this.specise + "数量:" + this.num)
}
cat1 = new cat();
cat1.info()

1回答
好帮手慕星星
2019-03-15
你好,经测试代码实现结果是正确的,很棒哦!
祝学习愉快!
相似问题