JavaScript Number toString()
method with radix param
You’re probably already familiar with thetoString()
method used on a Number object, it converts a number to a string. But do you know the toString()
method actually takes a parameter ‘radix’ (range between 2–36). This parameter specifies the base in which the integer is represented in the string. Here’s some example: