mozilla

Revision 66026 of Object.prototype

  • Revision slug: JavaScript/Reference/Global_Objects/Object/prototype
  • Revision title: prototype
  • Revision id: 66026
  • Created:
  • Creator: wizard04
  • Is current revision? No
  • Comment 4 words added, 40 words removed; page display name changed to 'prototype'

Revision Content

 

Summary

Represents the Object prototype object.

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.

=== Properties ===

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

=== Methods ===

__defineGetter__
{{ Non-standard_inline() }}
Associates a function with a property that, when accessed, executes that function and returns its return value.
__defineSetter__
{{ Non-standard_inline() }}
Associates a function with a property that, when set, executes that function which modifies the property.
eval
{{ Deprecated_inline() }}
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_inline() }}
Returns the function associated with the specified property by the __defineGetter__ method.
__lookupSetter__
{{ Non-standard_inline() }}
Returns the function associated with the specified property by the __defineSetter__ method.
__noSuchMethod__
{{ Non-standard_inline() }}
Allows a function to be defined that will be executed when an undefined object member is called as a method.
__parent__
{{ Non-standard_inline() }}
Points to an object's context.
propertyIsEnumerable
Returns a boolean indicating if the internal ECMAScript DontEnum attribute is set.
__proto__
{{ Non-standard_inline() }}
Points to the object which was used as prototype when the object was instantiated.
toSource
{{ Non-standard_inline() }}
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.
toLocaleString
Calls toString.
toString
Returns a string representation of the object.
unwatch
{{ Non-standard_inline() }}
Removes a watchpoint from a property of the object.
valueOf
Returns the primitive value of the specified object.
watch
{{ Non-standard_inline() }}
Adds a watchpoint to a property of the object.

{{ languages( { "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Object/prototype", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Object/prototype", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Object/prototype" } ) }}

Revision Source

<p> </p>
<h3 name="Summary">Summary</h3>
<p>Represents the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a> prototype object.</p>
<h3 name="Description">Description</h3>
<div class="onlyinclude">All objects in JavaScript are descended from
<div class="noinclude"><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Core_JavaScript_1.5_Reference:Global_Objects:Object</a></div>
<div class="includeonly"><code>Object</code>; all objects inherit methods and properties from <code>Object.prototype</code> , although they may be overridden. For example, other constructors' prototypes override the <code>constructor</code> property and provide their own <code>toString</code> methods. Changes to the <code>Object</code> prototype object are propagated to all objects unless the properties and methods subject to those changes are overridden further along the prototype chain.
<p>=== Properties ===</p>
<dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/constructor" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/constructor">constructor</a> </dt><dd> Specifies the function that creates an object's prototype. </dd></dl>
<p>=== Methods ===</p>
<dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineGetter" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineGetter">__defineGetter__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Associates a function with a property that, when accessed, executes that function and returns its return value. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineSetter" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineSetter">__defineSetter__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Associates a function with a property that, when set, executes that function which modifies the property. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/eval" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/eval">eval</a> </dt><dd> {{ Deprecated_inline() }} </dd><dd> Evaluates a string of JavaScript code in the context of the specified object. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/hasOwnProperty" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/hasOwnProperty">hasOwnProperty</a> </dt><dd> 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. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/isPrototypeOf" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/isPrototypeOf">isPrototypeOf</a> </dt><dd> Returns a boolean indication whether the specified object is in the prototype chain of the object this method is called upon. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupGetter" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupGetter">__lookupGetter__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Returns the function associated with the specified property by the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineGetter" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineGetter">__defineGetter__</a> method. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupSetter" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/lookupSetter">__lookupSetter__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Returns the function associated with the specified property by the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineSetter" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/defineSetter">__defineSetter__</a> method. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/noSuchMethod" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/noSuchMethod">__noSuchMethod__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Allows a function to be defined that will be executed when an undefined object member is called as a method. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/parent" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/parent">__parent__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Points to an object's context. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/propertyIsEnumerable" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/propertyIsEnumerable">propertyIsEnumerable</a> </dt><dd> Returns a boolean indicating if the internal <a href="/en/ECMAScript_DontEnum_attribute" title="en/ECMAScript_DontEnum_attribute">ECMAScript DontEnum attribute</a> is set. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/proto" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/proto">__proto__</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Points to the object which was used as prototype when the object was instantiated. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource">toSource</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> 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. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toLocaleString" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toLocaleString">toLocaleString</a> </dt><dd> Calls <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString">toString</a>. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString">toString</a> </dt><dd> Returns a string representation of the object. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/unwatch" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/unwatch">unwatch</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Removes a watchpoint from a property of the object. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/valueOf" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/valueOf">valueOf</a> </dt><dd> Returns the primitive value of the specified object. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/watch" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/watch">watch</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Adds a watchpoint to a property of the object.</dd></dl>

<p>{{ languages( { "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Object/prototype", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Object/prototype", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Object/prototype" } ) }}</p>
</div>
</div>
Revert to this revision