Mega Code Archive

 
Categories / JavaScript Tutorial / Function
 

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>