Basic HTML version of Foils prepared 23 June 1997

Foil 34 The arguments Array

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo


1 function foo(x1, x2) {
2 // the arguments array:
3 var argv = foo.arguments;
4 // number of arguments (same as argv.length):
5 var n = foo.arguments.length;
6 // y1 is same as this.x1 or argv[0]:
7 var y1 = foo.arguments[0];
8 // the last argument (same as argv[n-1]):
9 var yn = foo.arguments[n-1];
10 // use inside function to determine caller:
11 var wherefrom = foo.caller;
12 }
13 This allows one to process functions with a variable number of arguments
14 The arguments array is a property of all user-defined functions and Function objects.

in Table To:


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Wed Apr 1 1998