toString

 

Summary

Returns a string representing the specified object.

Method of String
Implemented in JavaScript 1.1
ECMAScript Edition ECMAScript 1st Edition

Syntax

string.toString()

Parameters

None.

Description

The String object overrides the toString method of the Object object; it does not inherit Object.toString. For String objects, the toString method returns a string representation of the object.

Examples

Example: Using toString

The following example displays the string value of a String object:

x = new String("Hello world");
alert(x.toString())      // Displays "Hello world"

See also

Object.toString

 

Tags (0)

Edit tags
  • No tags

Attachments (0)

 

Attach file