Visit Mozilla.org

Core JavaScript 1.5 Guide:Predefined Functions:Number and String Functions

From MDC

[edit] Number and String Functions

The Number and String functions let you convert an object to a number or a string. The syntax of these functions is:

Number(objRef)
String(objRef)

where objRef is an object reference.

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

D = new Date (430054663215)
// The following returns
// "Thu Aug 18 04:37:43 GMT-0700 (Pacific Daylight Time) 1983"
x = String(D)

« Previous Next »