Discuss / JavaScript / 为什么要在内部用call()一下希望“继承”的构造函数?

为什么要在内部用call()一下希望“继承”的构造函数?

Topic source

直接用extends继承不行么?

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

你不call一下Student,那些定义在Student函数内部的属性无法被初始化


  • 1

Reply