prototype Object class property
JS Home <<
JS Reference <<
Object <<
prototype
Description
Enables property assignment to objects of type Object.
- All objects are descendants of
Object. - All objects inherit their properties and methods from
Object.prototype. - So when overriding an
Objectmethod such asvalueOf(), you would override as follows:
yourObject.prototype.valueOf = function functionName {your override code}
- Like all class properties
prototypeshould be used on the class rather than an instance of the class.
Syntax
| Signature | Description |
|---|---|
Object.prototype | Enables property assignment to objects of type Object. |
Parameters
None.
Examples
The code below displays Object prototype.
alert('Object prototype is ' + Object.prototype);
Related Tutorials
JavaScript Advanced Tutorials - Lesson 5 - Elegant Object Creation
