// 本质是让子类的实例的原型等于傅雷的原型 // 子 function SuperFunction(flag1){ this.flag1 = flag1 } // function SubFunction(flag2){ this.flag2 = flag2 } var SuperInstance = new SuperFunction(true) SubFunction.prototype = SuperInstance var SubInstance = new SubFunction(false) console.log(SubInstance.flag2,SubInstance.flag1 )