console
function Person () {
this.name = ['赵云']
}
Person.prototype.getName = function () {
return this.name
}
function Child () {
}
Child.prototype = new Person()
var child1 = new Child()
child1.name.push('张飞')
var child2 = new Child()
console.log(child1.name)
console.log(child2.name)
console.log(child2.getName())
<!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>