Edit This Code:
See Result »
The toString() method can output numbers as base 16 (hex), base 8 (octal), or base 2 (binary).
Try it
Result: