理解prototype继承之前先理解prototype、__proto__、constructor
function Objfather (){
this.role = "父亲";
}
console.log(Objfather.prototype)
Objfather.prototype中有两个属性。分别是 constructor和__proto__
constructor指向当前原型的构造函数,所以这里还是指向Objfather本身。
__proto__指向构造该对象的构造函数的prototype(因为Objfather上级为Object),所以这里指向Object.prototype
如下有一个子构造函数
function Objchidren(name,age){
this.name = name;
this.age = a