View Single Post
  #2 (permalink)  
Old September 18th, 2016, 12:22 AM
xioqua xioqua is offline
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by leejim View Post
in chapter 6.3.3 combination inheritance sample.
in the code "SubType.prototype.constructor = Subtype"
why not "Subtype.protytype.constructor = SuperType"?
you can see 6.3.1

the previous SubType.constructor is Function SubType; but now SubType is the instance of SuperType, "SuperType.constructor = SuperType" is just equal to "SubType.prototype.constructor = SuperType";

So if you do "SubType.protytype.constructor = SuperType", there will no change;

But, In my view, I think this“SubType.prototye = SubType” is not important, for
"SuperType.call(this, name);" is always work.
Reply With Quote