JavaScript & jQuery Tutorials

JS Home Right Arrow JS Reference Right Arrow Function Right Arrow toString()

toString()  Function  instance method

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

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