![]() |
![]() |
|||||
|
arguments |
An array containing each argument passed to the currently executing function. |
caller |
A reference to the function that invoked the current function |
length |
The number of arguments to the function. |
Syntax 1
function functionname( [argname1 [, ... argnameN]] )
{
body
}
Syntax 2
var functionname = new Function( [argname1, [... argnameN,]] body );
Arguments
Remarks
Syntax 1 is the standard way to create new functions in JScript. Syntax 2 is an alternative form used to create function objects explicitly.function add(x, y)
{
return x + y;
}
Example 2var add = new Function("x", "y", "return x+y");
In either case, you call the function with a line of code similar to the following:add(2, 3);
Copyright © 2000 Chili!Soft