var a = 5;
This will output:
You can give toString() a parameter which is the radix in which to output the number.
Of course you can use 8 to get octal version or 16 to get the hexa version of the number.
Very powerful and also very simple