JavaScript & jQuery Tutorials

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

toString()  String  instance method

Description

Returns a string of the specified object.

This method overrides the toString() method of Object.

Syntax


Signature Description
aString.toString()Returns a string of the specified object.

Parameters

None.

Examples

The code below creates a string and displays it.


// Create a String object.
someString = new String("Learn Javascript");
alert(someString.toString()); 

Press the button below to action the above code:

Related Tutorials

JavaScript Basic Tutorials - Lesson 8 - Strings



  

go to home page Homepage go to top of page Top