JavaScript - toString Method

Last Updated Jul 29, 2015, 07:00:14 PM





The JavaScript toString method is used to convert number to a string
Syntax

The toString() method parses its first argument, and attempts to return a string representation in the specified radix (base). For radixes above 10, the letters of the alphabet indicate numerals greater than 9. For example, for hexadecimal numbers (base 16), a through f are used.


Example
Try It Now

Other JavaScript Number Object Methods you might want to learn

valueOf()

toFixed()

toLocaleString()

toPrecision()

Browser compatibility

Feature
toString Yes Yes Yes Yes Yes Yes Yes



Sources and Credits

The source of the content has been referred and updated with Mozilla Developer Network and W3C Organization

Last Updated Jul 29, 2015, 07:00:14 PM