SOURCE

console 命令行工具 X clear

                    
>
console
function Person(name) {
    this.name = [name]
}

Person.prototype.getName = function () {
    return this.name
}

function Child(name) {
    Person.call(this, name)
}

Child.prototype = Object.create(Person.prototype)
Child.prototype.constructor = Child


var child1 = new Child('赵云')
child1.name[0] = '张飞'
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>