HTML and CSS Reference
In-Depth Information
Figure 8.17 Adding a new method with a prototype.
8.5.4 Properties and Methods of All Objects
As we have seen, all user-defined objects and built-in objects are descendants of the
object called Object . The Object object has its own properties and methods that can be
accessed by any objects derived from it.
All objects have the properties and methods shown in Tables 8.1 and 8.2.
Table 8.1 Object Properties
Property
What It Provides
constructor
A reference to the function that created the object.
prototype
A reference to the object prototype for the object. This allows
the object to share properties and methods.
Table 8.2 Some Object Methods
Method
What It Does
toString()
Returns a string representing a specified object.
valueOf()
Returns a primitive value for a specified object.
 
 
Search WWH ::




Custom Search