3 ms·
> parseInt("123") // base 10 => 123 The radix is not always 10 by default, it's implementation dependent and sometime it even depends on the number to be pa
by laurent123456 13y ago
> parseInt("123") // base 10 => 123
The radix is not always 10 by default, it's implementation dependent and sometime it even depends on the number to be parsed. "8" will be parsed in base 10, "08" in base 8. Always specify the radix [1]
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...