contents   index   previous   next



global.ToString()

syntax:

ToString(value)

where:

value - to be cast as a string.

 

return:

string - conversion of value.

 

description:

The following table lists how different data types are converted by is this function.

 

Boolean
"false", if value is false, else "true"

null
"null"

Number
if value is NaN, return "NaN". If +0 or -0, return "0". If Infinity, return "Infinity". If a number, return a string representing the number. If a number is negative, return "-" concatenated with the string representation of the number.

Object
first, call ToPrimitive(), then call ToString() and return result

String
same as value

undefined
"undefined"

see:

global.ToPrimitive(), global.ToNumber()

 

 


global.ToUint16()