Revision 74802 of Function.arity

  • Revision slug: JavaScript/Reference/Global_Objects/Function/arity
  • Revision title: arity
  • Revision id: 74802
  • Created:
  • Creator: Mgjbot
  • Is current revision? No
  • Comment robot Adding: pl

Revision Content

{{ Deprecated_header() }}

Summary

Specifies the number of arguments expected by the function.

Property of Function
Implemented in: JavaScript 1.2, NES 3.0

JavaScript 1.4: Deprecated.

Description

arity is no longer used and has been replaced by the length property.

arity is external to the function, and indicates how many arguments a function expects. By contrast, arguments.length provides the number of arguments actually passed to a function.

Examples

Example: Using arity

See example in Function.length

See Also

arguments.length, Function.length

{{ languages( { "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Function/arity" } ) }}

Revision Source

<p>
{{ Deprecated_header() }}
</p>
<h3 name="Summary"> Summary </h3>
<p>Specifies the number of arguments expected by the function.
</p>
<table class="fullwidth-table">
<tbody><tr>
<td class="header" colspan="2">Property of <a href="en/Core_JavaScript_1.5_Reference/Objects/Function">Function</a></td>
</tr>
<tr>
<td>Implemented in:</td>
<td>JavaScript 1.2, NES 3.0
<p>JavaScript 1.4: Deprecated.
</p>
</td>
</tr>
</tbody></table>
<h3 name="Description"> Description </h3>
<p><code>arity</code> is no longer used and has been replaced by the <code><a href="en/Core_JavaScript_1.5_Reference/Objects/Function/length">length</a></code> property.
</p><p><code>arity</code> is external to the function, and indicates how many arguments a function expects. By contrast, <code><a href="en/Core_JavaScript_1.5_Reference/Objects/Function/arguments/length">arguments.length</a></code> provides the number of arguments actually passed to a function.
</p>
<h3 name="Examples"> Examples </h3>
<h4 name="Example:_Using_arity"> Example: Using <code>arity</code> </h4>
<p>See example in <a href="en/Core_JavaScript_1.5_Reference/Objects/Function/length#Example:_Using_Function.length_and_arguments.length">Function.length</a>
</p>
<h3 name="See_Also"> See Also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Objects/Function/arguments/length">arguments.length</a>,
<a href="en/Core_JavaScript_1.5_Reference/Objects/Function/length">Function.length</a>
</p>{{ languages( { "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Function/arity" } ) }}
Revert to this revision