This documentation is archived and is not being maintained.
length Property (arguments)
Visual Studio 2010
Returns the actual number of arguments passed to a function by the caller.
[function.]arguments.length
The length property of the arguments object is initialized by the scripting engine to the actual number of arguments passed to a Function object when execution begins in that function.
Note |
|---|
The arguments object is not available when a program is running in fast mode, the default for JScript. To compile a program that uses the arguments object from a command prompt, you must turn off the fast option by using /fast-. It is not safe to turn off the fast option in ASP.NET because of threading issues. For more information, see arguments Object. |
The following example illustrates the use of the length property of the arguments object.
function ArgTest(a, b)
{
print ("Expected Arguments: " + ArgTest.length);
print ("Passed Arguments: " + arguments.length);
var s = "The individual arguments are: "
for (var n = 0; n < arguments.length; n++)
{
s += ArgTest.arguments[n];
s += " ";
}
print (s);
}
Show:
Note