toString()  Function  instance method getterS2C Home  « Globals « Function « toString()

Description

Returns a string composed of concatenated function elements delimited by commas.

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());

Press the button below to action the above code:


Related Tutorials

JavaScript Intermediate Tutorials - Lesson 8 - Functions


go to home page Homepage go to top of page Top