Accessing Function Arguments with the arguments Array : arguments « Function « JavaScript Tutorial






It is possible to access the arguments as an array.

<html>
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
    function displayArguments()
    {
      document.write("The following arguments were passed:<BR>");
      for(i=0; i<arguments.length; i++)
      {
        document.write(i," = ",arguments[i],"<BR>");
      }
    }
    displayArguments(3,"AAA",-7,"BBB");
-->
</SCRIPT>
</html>








7.4.arguments
7.4.1.arguments
7.4.2.arguments.callee
7.4.3.arguments.caller
7.4.4.arguments.length
7.4.5.Use arguments.callee.toString() to get the source of the function
7.4.6.Accessing Function Arguments with the arguments Array
7.4.7.Get function parameter length