Gets the number of arguments defined for a function.
SyntaxfunctionName.length
Examples
The following example illustrates the use of the length property:
function ArgTest(a, b){
var s = "";
s += "Expected Arguments: " + ArgTest.length;
s += "<br />";
s += "Passed Arguments: " + arguments.length;
return s;
}
document.write(ArgTest(1, 2));
Remarks
The required functionName is the name of the function.
The length property of a function is initialized by the scripting engine to the number of arguments in the function’s definition when an instance of the function is created.
What happens when a function is called with a number of arguments different from the value of its length property depends on the function.
See also Other articles AttributionsMicrosoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4