DEV Community

Discussion on: What is happening under the hood when you use toString(2) in JavaScript?

Collapse
 
hbgl profile image
hbgl

The specification says that the result of toString(radix) with radix != 10 is implementation dependent. Nevertheless, I assume that result should be pretty consistent across runtimes.

If you really want to know what happens under the hood, then you need to look at the source code of actual JavaScript runtimes. The nice thing is that many of them are open source. Here are some implementations of toString(radix):

Collapse
 
jasterix profile image
Jasterix

Thanks for sharing! I didn't even consider doing that