Function.arity : Function Object : Function JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Function » Function Object »

 

Function.arity








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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Function
» Function Object