请老师检查是否正确

来源: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()

http://img.mukewang.com/climg/5c8a4415000132f804750527.jpg

写回答

1回答

好帮手慕星星

2019-03-15

你好,经测试代码实现结果是正确的,很棒哦!

祝学习愉快!

0

0 学习 · 14456 问题

查看课程