<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
</head>
<body>
<script type="text/javascript">
function Human(name) {
this.name = name
this.kingdom = 'animal'
this.color = ['yellow', 'white', 'brown', 'black']
}
function Chinese(name,age){
Human.call(this,name)
this.age = age
this.color = 'yellow'
}
// 补全代码 (原型链继承)
Chinese.prototype = new Human()
Human.prototype.getName = function() { return this.name}
Chinese.prototype.getAge = function() { return this.age}
</script>
</body>
</html>

京公网安备 11010502036488号