Function
| Module | ejs |
| Namespace | intrinsic |
| Definition | final class Function |
| Inheritance | Function Object |
The Function type is used to represent closures, function expressions and class methods.
It contains a reference to the code to execute, the execution scope and possibly a bound "this" reference.
Properties
| Qualifiers | Property | Type | Description |
|---|---|---|---|
| No properties defined | |||
Function Methods
| Qualifiers | Method |
|---|---|
| public | apply(thisObject: Object, args: Array): Object |
| Invoke the function on another object. | |
| public | call(thisObject: Object, args: Array): Object |
| Invoke the function on another object. |
Method Detail
Invoke the function on another object.
- Parameters
thisObject: Object The object to set as the "this" object when the function is called. args: Array Array of actual parameters to the function.
- Returns
- Any object returned as a result of applying the function.
Throws
ReferenceError: If the function cannot be applied to this object.
Invoke the function on another object.
- Parameters
thisObject: Object The object to set as the "this" object when the function is called. args: Array Array of actual parameters to the function.
- Returns
- Any object returned as a result of applying the function.
Throws
ReferenceError: If the function cannot be applied to this object.