• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Functions > The Arguments Class

The Arguments Class

Each time a function is invoked, an Arguments object is created automatically and can be referenced using the local variable arguments, which is automatically included within the scope of the function. Basically, arguments are the parameters you define when you invoke any function. The arguments variable of any function is more like an array (refer to Chapter 10, “Arrays,” for more on arrays). As with an array, you can call specific elements as well as the number of total elements. The arguments variable can be used to get information about any and all of the parameters being passed to that function.

Let's start with the number of arguments in a given function. Gathering this information is as easy as using the length property of the arguments object.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint