在文章一开始写到了下面这个错误的原型链:
new PrimaryStudent() ----> PrimaryStudent.prototype ----> Object.prototype ----> null
其实这个时候,不光是原型链错误了,甚至用PrimaryStudent new出来的实例根本没有hello这个方法,更无从谈继承了。
哪里错了?
Sign in to make a reply
arcelan
在文章一开始写到了下面这个错误的原型链:
其实这个时候,不光是原型链错误了,甚至用PrimaryStudent new出来的实例根本没有hello这个方法,更无从谈继承了。