Function.prototype

  • Revision slug: JavaScript/Reference/Global_Objects/Function/prototype
  • Revision title: prototype
  • Revision id: 79803
  • Created:
  • Creator: delae
  • Is current revision? No
  • Comment 4 words removed

Revision Content

Summary

Represents the Function prototype object. <table class="fullwidth-table"> <tr> <td class="header" colspan="2">Property of {{ mediawiki.internal('Core JavaScript 1.5 Reference:Objects:Function|Function', "en") }}</td> </tr> <tr> <td>Implemented in:</td> <td>JavaScript 1.1, NES 2.0</td> </tr> <tr> <td>ECMA Version:</td> <td>ECMA-262</td> </tr> </table>

Description

Function objects inherit from Function.prototype. Modifications to the Function.prototype object are propagated to all Function instances.

Properties

arguments
{{ Deprecated_inline() }}
An array corresponding to the arguments passed to a function. This is deprecated as property of Function, use the arguments object available within the function instead.
arity
{{ Deprecated_inline() }}
Specifies the number of arguments expected by the function. Use the length property instead.
caller
{{ Non-standard_inline() }}
Specifies the function that invoked the currently executing function.
constructor
Specifies the function that creates an object's prototype.
length
Specifies the number of arguments expected by the function.
name
{{ Non-standard_inline() }}
The name of the function.

Methods

apply
Applies the method of another object in the context of a different object (the calling object); arguments can be passed as an Array object.
call
Calls (executes) a method of another object in the context of a different object (the calling object); arguments can be passed as they are.
toSource
{{ Non-standard_inline() }}
Returns a string representing the source code of the function. Overrides the Object.toSource method.
toString
Returns a string representing the source code of the function. Overrides the Object.toString method.

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

Revision Source

<div class="noinclude">
<h3 name="Summary">Summary</h3>
<p>Represents the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Function</a> prototype object. <span class="comment">&lt;table class="fullwidth-table"&gt; &lt;tr&gt; &lt;td class="header" colspan="2"&gt;Property of {{ mediawiki.internal('Core JavaScript 1.5 Reference:Objects:Function|Function', "en") }}&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Implemented in:&lt;/td&gt; &lt;td&gt;JavaScript 1.1, NES 2.0&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;ECMA Version:&lt;/td&gt; &lt;td&gt;ECMA-262&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</span></p>
<h3 name="Description">Description</h3>
</div>
<div class="noinclude"><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function">Core_JavaScript_1.5_Reference:Global_Objects:Function</a></div>
<div class="includeonly">
<p><code>Function</code> objects inherit from <code><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/prototype" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/prototype">Function.prototype</a></code>. Modifications to the <code>Function.prototype</code> object are propagated to all <code>Function</code> instances.</p>
<h3 name="Summary">Properties</h3>
<dl><dt><a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/arguments" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/arguments">arguments</a> </dt><dd> {{ Deprecated_inline() }} </dd><dd> An array corresponding to the arguments passed to a function. This is deprecated as property of <code>Function</code>, use the <a href="/En/Core_JavaScript_1.5_Reference/Functions_and_function_scope/arguments" title="en/Core_JavaScript_1.5_Reference/Functions/arguments">arguments</a> object available within the function instead. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/arity" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/arity">arity</a> </dt><dd> {{ Deprecated_inline() }} </dd><dd> Specifies the number of arguments expected by the function. Use the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/length" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/length">length</a> property instead. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/caller" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/caller">caller</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Specifies the function that invoked the currently executing function. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/constructor" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/constructor">constructor</a> </dt><dd> Specifies the function that creates an object's prototype. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/length" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/length">length</a> </dt><dd> Specifies the number of arguments expected by the function. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/name" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/name">name</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> The name of the function. </dd></dl>
<h3 name="Methods">Methods</h3>
<dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/apply">apply</a> </dt><dd> Applies the method of another object in the context of a different object (the calling object); arguments can be passed as an Array object. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/call" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/call">call</a> </dt><dd> Calls (executes) a method of another object in the context of a different object (the calling object); arguments can be passed as they are. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/toSource" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/toSource">toSource</a> </dt><dd> {{ Non-standard_inline() }} </dd><dd> Returns a string representing the source code of the function. Overrides the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toSource">Object.toSource</a> method. </dd></dl> <dl><dt> <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Function/toString" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Function/toString">toString</a> </dt><dd> Returns a string representing the source code of the function. Overrides the <a href="/en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString">Object.toString</a> method. </dd></dl></div>
<p>{{ languages( { "es": "es/Referencia_de_JavaScript_1.5/Objetos_globales/Function/prototype", "fr": "fr/R\u00e9f\u00e9rence_de_JavaScript_1.5_Core/Objets_globaux/Function/prototype", "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Function/prototype", "ko": "ko/Core_JavaScript_1.5_Reference/Global_Objects/Function/prototype", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Function/prototype" } ) }}</p>
Revert to this revision