Discuss / JavaScript / 添加一个tip

添加一个tip

Topic source

arcelan

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

在文章一开始写到了下面这个错误的原型链:

new PrimaryStudent() ----> PrimaryStudent.prototype ----> Object.prototype ----> null

其实这个时候,不光是原型链错误了,甚至用PrimaryStudent new出来的实例根本没有hello这个方法,更无从谈继承了。

哪里错了?


  • 1

Reply