继承方法-->一级一级继承

Grand.prototype.lastName = 'ji';
function Grand(){};
var grand = new Grand();
Father.prototype = grand;
function Father(){
this.name = 'hehe';
};
var father = new Father();
Son.prototype = father;
function Son(){
this.name = 'klkx'
};
var son = new Son();
console.log(son);

继承方法-->一级一级继承

缺点没有必要的属性也一并继承了

上一篇:遇到Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so问题的解决方法


下一篇:vue 身份证18位验证