function Father(name) {
this.name = name;
}
Father.prototype.sayName = function() {
console.log(this.name);
}
function Mother(name) {
this.name = name;
}
Mother.prototype.sayHello = function() {
console.log('Hello ' + this.name);
}
function Son(name) {
Father.call(this, name);
Mother.call(this, name);
}
Son.prototype = Object.create(Father.prototype);
Object.assign(Son.prototype, Mother.prototype);
Son.prototype.constructor = Son;
let son = new Son('Kevin');
son.sayName();
son.sayHello();
console.log(Son.prototype.constructor)
console.log(son instanceof Son)
console.log(son instanceof Father)
console.log(son instanceof Mother)
console