mozilla

Revision 74809 of Function.arity

  • Revision slug: JavaScript/Reference/Global_Objects/Function/arity
  • Revision title: arity
  • Revision id: 74809
  • Created:
  • Creator: evilpie
  • Is current revision? No
  • Comment 20 words removed

Revision Content

{{ Obsolete_header() }}

Summary

Specifies the number of arguments expected by the function.

Property of Function
Implemented in JavaScript 1.2
ECMAScript Edition None

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.

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

Revision Source

<p>{{ Obsolete_header() }}</p>
<h2 name="Summary">Summary</h2>
<p>Specifies the number of arguments expected by the function.</p>
<table class="standard-table"> <thead> <tr> <th class="header" colspan="2">Property of <a href="/en/JavaScript/Reference/Global_Objects/Function" title="en/JavaScript/Reference/Global_Objects/Function"><code>Function</code></a></th> </tr> </thead> <tbody> <tr> <td>Implemented in</td> <td>JavaScript 1.2</td> </tr> <tr> <td>ECMAScript Edition</td> <td>None</td> </tr> </tbody>
</table>
<h2 name="Description">Description</h2>
<p><code>arity</code> is no longer used and has been replaced by the <code><a href="/en/JavaScript/Reference/Global_Objects/Function/length" title="en/JavaScript/Reference/Global_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 class=" external" href="mks://localhosten/en/JavaScript/Reference/Objects/Function/arguments/length" title="en/JavaScript/Reference/Objects/Function/arguments/length">arguments.length</a></code> provides the number of arguments actually passed to a function.</p>
<p>{{ languages( { "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Function/arity" } ) }}</p>
Revert to this revision