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()
js call的繼承方式,為什么刪除call只通過new也是可以實現(xiàn)繼承的?
開心每一天1111
2019-03-29 22:19:26