Accessing Function Arguments with the arguments Array : arguments : Function JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Function » arguments »

 

Accessing Function Arguments with the arguments Array







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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Function
» arguments