toString()
Function
instance method
JS Home <<
JS Reference <<
Function <<
toString()
Description
Returns a string representation of the function.
This method overrides the toString()
method of Object
.
Syntax
Signature | Description |
---|---|
aFunction.toString() | Returns a string representation of the function. |
Parameters
None.
Examples
The code below creates a function and displays it as a string.
// Create a function.
var newFunction = new Function('a', 'return a * a');
alert(newFunction.toString());
Related Tutorials
JavaScript Intermediate Tutorials - Lesson 8 - Functions