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

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