Skip to content
FLAVIO COPES
flaviocopes.com
2026

The Number toString() method

By Flavio Copes

Learn how the JavaScript Number toString() method returns a string representation of a number, and how the optional radix prints it in binary, octal, or hex.

~~~

This method returns a string representation of the Number object. It accepts an optional argument to set the radix:

new Number(10).toString() //10
new Number(10).toString(2) //1010
new Number(10).toString(8) //12
new Number(10).toString(16) //a
Tagged: JavaScript ยท All topics
~~~

Related posts about js: