String (function)

Converts the specified object to a string.

Core function

Syntax

String( obj )

Parameters

Parameter Description
obj An object.

Description

String is a top-level function and is not associated with any object.

The String function converts the value of any object into a string; it returns the same value as the toString method of an individual object.

When the object is a Date object, String returns a more readable string representation of the date. Its format is: Thu Aug 18 04:37:43 Pacific Daylight Time 1983.

Example

The following example converts the Date object to a readable string.

This produces the result "Thu Aug 18 04:37:43 GMT-0700 (Pacific Daylight Time) 1983."

See also

String

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.