• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 21. Packaging Data and Functions... > Creating Class Hierarchies Using the...

Creating Class Hierarchies Using the __proto__ Property

You can create class hierarchies by pointing the prototype.__proto__ property of the subclass to the prototype property of the superclass. For example, the following line makes Raptor a subclass of Predator:

Raptor.prototype.__proto__ = Predator.prototype; 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint