Function.arity : Function Object « Function « JavaScript Tutorial






The arity property represents the number of declared arguments a function expects to receive.

The arity property is valid when the language attribute of the script tag is set to JavaScript1.2.

<html>
    <body>
    <script lanuguage="JavaScript1.2">
    <!--
    function subtract(first, second){
      var result = first - second;
      return result;
    }
    document.write("arity = " + subtract.arity + "<br>")
    document.write("The result of the subtract function is: " + subtract(4,3));
    -->
    </script>
    </body>
    </html>








7.2.Function Object
7.2.1.Function() (capital F)
7.2.2.Function.apply()
7.2.3.Function.arguments
7.2.4.Function.arity
7.2.5.Function.call()
7.2.6.Function.caller
7.2.7.Function.prototype
7.2.8.Function.toSource()
7.2.9.Function.toString()