Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Object:prototype

From MDC


Contents

[edit] Summary

Represents the Object prototype object.

[edit] Description

All objects in JavaScript are descended from Object; all objects inherit methods and properties from Object.prototype, although they may be overridden. For example, other constructors' prototypes override the constructor property and provide their own toString methods. Changes to the Object prototype object are propagated to all objects unless the properties and methods subject to those changes are overridden further along the prototype chain.

[edit] Properties

constructor
Specifies the function that creates an object's prototype.

[edit] Methods

__defineGetter__
Non-standard
Associates a function with a property that, when accessed, executes that function and returns its return value.
__defineSetter__
Non-standard
Associates a function with a property that, when set, executes that function which modifies the property.
eval
Deprecated
Evaluates a string of JavaScript code in the context of the specified object.
hasOwnProperty
Returns a boolean indicating whether an object contains the specified property as a direct property of that object and not inherited through the prototype chain.
isPrototypeOf
Returns a boolean indication whether the specified object is in the prototype chain of the object this method is called upon.
__lookupGetter__
Non-standard
Returns the function associated with the specified property by the __defineGetter__ method.
__lookupSetter__
Non-standard
Returns the function associated with the specified property by the __defineSetter__ method.
__noSuchMethod__
Non-standard
Allows a function to be defined that will be executed when an undefined object member is called as a method.
propertyIsEnumerable
Returns a boolean indicating if the internal ECMAScript DontEnum attribute is set.
toSource
Non-standard
Returns string containing the source of an object literal representing the object that this method is called upon; you can use this value to create a new object.
toString
Returns a string representation of the object.
unwatch
Non-standard
Removes a watchpoint from a property of the object.
valueOf
Returns the primitive value of the specified object.
watch
Non-standard
Adds a watchpoint to a property of the object.