Function
Module | ejs |
Definition | final class Function |
Inheritance | Function ![]() |
Stability | Evolving. |
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.
- Description
- This function takes the "this" parameter and then a variable number of actual parameters to pass to the function.
- Parameters
thisObject: Object The object to set as the "this" object when the function is called. args: Array 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.