toString()

The toString() method is used to return a string version of the the number of a number base specified by the given radix parameter, allowing you to perform number base conversions.

syntax:

toString(radix)

EXAMPLE

var numOne = 32

var numTwo = a.toString(16)

The above example, when used within a function, will return the value of the variable 'numTwo', which is '20'. The base-10 number as the value of variable numOne, which was 32, is converted to the hexadecimal (base 16) number '20'.