7-2编程这样做对吗?
来源:7-2 编程练习
慕粉13657933304
2018-08-31 21:43:29
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<script>
//补充代码
function animal(){
this.name='狗狗';
this.foot='食物';
this.say=function(){
alert(this.name+"喜欢吃"+this.foot)
}
}
function dog(){
animal.call(this,',');
}
var c= new dog();
c.say();
</script>
</body>
</html>
1回答
您好,效果是可以的,继续加油!
相似问题