parseInt(5)
parseInt(5)
parseInt(5)
It's because parseInt is expecting a string, so the decimal gets converted to a string, and 0.0000005.toString()
returns 5e-7
.
Common Dynamic Typing L
More like javascript L, even python would throw a TypeError for this example.
And to further expand on that, if you do pass in a sting string, it handles it correctly.
> parseInt('0.0000005') 0
What if I pass in a Stewart Copeland?
😆 I'll be watching you...
or a Honda civic