Microsoft® JScript® arguments Property |
Language Reference Version 2 |
Returns an array containing each argument passed to the currently executing function.
function.arguments[ ]The function argument is the name of the currently executing function.
The arguments property allows a graceful way for functions to handle a variable number of arguments. The length property of the array contains the number of arguments passed to the function.The following example illustrates the use of the arguments property:
function ArgTest() { var i, s, numargs = ArgTest.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 += ArgTest.arguments[i] + " "; } return(s); }