JavaScript functions have a special property called arguments, which contains an array of input parameters. Using the "length" property of an array, you can iterate through the array for each parameter. This enables you to develop functions that can change as their parameters do.
<HTML>
<HEAD>
<SCRIPT Language="JavaScript">
function foo() {
var argv = foo.arguments;
var argc = argv.length;
for (var i = 0; i < argc; i++) {
alert("Argument " + i + " = " + argv[i]);
}
}
</SCRIPT>
</HEAD>
<BODY onload="foo('hello', 'world');">
</BODY>
</HTML>