Why does JavaScript convert parseInt(0000000101126) to 33366 instead of 101126?
var example = parseInt(0000000101126);
console.log(example); //33366
JavaScript assumes the following:
•If the string begins with "0x", the radix is 16 (hexadecimal)
•If the string begins with "0", the radix is 8 (octal). This feature is deprecated
•If the string begins with any other value, the radix is 10 (decimal)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With