console
function Person (name) {
var age = 12
this.name = [name]
}
Person.prototype.type = 'people'
Person.prototype.getName = function () {
return this.name
}
function Child (name) {
Person.call(this, name)
}
var child1 = new Child('菜鸡')
child1.name[0] = '典韦'
var child2 = new Child('菜鸡')
console.log(child1.name)
console.log(child2.name)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=, initial-scale=">
<meta http-equiv="X-UA-Compatible" content="">
<title>构造函数的继承</title>
</head>
<body>
</body>
</html>