function Base() {
this.name='name'
this.age=18
}
Base.prototype={
say() {
alert('hi')
},
ex:'lucy'
}
function Student() {
Base.call(this,arguments)////// 删除这句话也可以,为什么??????
this.add='US'
}
Student.prototype=new Base()//只通过这个就行,那还要上面的call有什么用?
let tom=new Student()
tom.say()
开心每一天1111
陪伴而非守候
随时随地看视频慕课网APP
相关分类