toString Method (String) 1

Returns a string representation of a string.

Syntax


string.toString()  

Parameters

string
Required. The array to represent as a string.

Return Value

The string representation of the string.

Example

The following example illustrates the use of the toString method with a string.

var string = "this is a test";  
var strStr = string.toString();  
document.write(strStr);  

// Output: this is a test  

Requirements

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards, Internet Explorer 10 standards, Internet Explorer 11 standards. Also supported Store apps (Windows 8 and Windows Phone 8.1). See Version Information.