详解JS继承
一:原型链继承
原型链继承:
function Father(){
this.showArr = [1,2,3];
this.showName = 'Father';
}
function Mother(){
this.showArr = [4,5,6];
this.showName = 'Mother';
}
function Child(){
this.age = 18;
}
var Father = new Father();
Child.prototype = Father;
var So
原创
2020-12-01 20:21:27 ·
4071 阅读 ·
2 评论