Function
Wraps a built-in or JavaScript function.
Go to Property Listing | Method Listing
Methods:
Objects:
Property Listing
Property |
Type |
Access |
Description |
---|---|---|---|
read/write |
The function arguments, packed into an array. This property is deprecated; use the arguments property within the function body. |
||
readonly |
The number of formal arguments. This property is deprecated; use the length property instead. |
||
readonly |
The number of formal arguments. |
||
readonly |
The function name. |
Method Listing
Constructor
Function Function (arguments:String, body:String)
The Function constructor parses the argument list and creates a Function object.
Parameter |
Type |
Description |
---|---|---|
arguments |
The list of formal arguments, separated by commas. The formal arguments can also be supplied one by one; in this case, the last argument to the Function constructor is considered to be the function body. |
|
body |
The body of the function to create. |
Varies apply (thisObj:Object, args:Array)
Apply a this object and an argument list to a function.
This function is different from call(); here, the arguments are suppliedas an Array object.
Parameter |
Type |
Description |
---|---|---|
thisObj |
The object to be used as this. |
|
args |
An array of arguments. |
Varies call (thisObj:Object, argument:Varies)
Apply a this object and arguments to a function.
This function is different from apply(); here, the arguments are supplied one by one.
Parameter |
Type |
Description |
---|---|---|
thisObj |
The object to be used as this. |
|
argument |
Varies |
The first agument to the function. Add as many as needed. |
String toSource ()
Creates a string representation of this object that can be fed back to eval() to re-create an object. Works only with JavaScript functions.
String toString ()
Returns the function definition as a string.