Returns the arguments object for the currently executing Function object.
function.arguments |
Remarks
The function argument is the name of the currently executing function, and can be omitted.
The arguments property allows a function to handle a variable number of arguments. The length property of the arguments object contains the number of arguments passed to the function. The individual arguments contained in the arguments object can be accessed in the same way array elements are accessed.
Example
The following example illustrates the use of the arguments property:
Copy Code | |
---|---|
function ArgTest(){ var i, s, numargs = arguments.length; s = numargs; if (numargs < 2) s += " argument was passed to ArgTest. It was "; else s += " arguments were passed to ArgTest. They were " ; for (i = 0; i < numargs; i++) { s += arguments[i] + " "; } return(s); } |
Requirements
Applies To: Function Object (JScript 5.6)