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

Chapter 8. Objects > Object Properties and Methods

8.7. Object Properties and Methods

As we discussed earlier, all objects in JavaScript inherit from the Object class. While more specialized classes, such as the built-in String class or a user-defined Complex class, define properties and methods of their own, all objects, whatever their class, also support the properties and methods defined by the Object class. Because of their universality, these properties and methods are of particular interest.

8.7.1. The constructor Property

Starting with JavaScript 1.1, every object has a constructor property that refers to the constructor function used to initialize the object. For example, if I create an object o with the Complex( ) constructor, the property o.constructor refers to Complex:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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