August 1999
Intermediate to advanced
1488 pages
72h 53m
English
function.arity
The arity property of the Function object represents the number of declared arguments a function expects to receive. This is valid when the language attribute of the script tag is set to JavaScript1.2.
Listing 6.127 shows how arity can be used. The first line written to the user's page contains the number of arguments passed to the function. The second line is the result of running the script.
<html> <body> <script lanuguage="JavaScript1.2"> <!–– Hide // function subtracts the second number from the first function subtract(first, second){ var result = first – second; return result; } // Write the results to the ... |
Read now
Unlock full access