What's happening here and why?
document.write(0154); // === 108
Numbers that begin with 0 are considered octal (base-8) numbers.
base 8 [0154] = base 10 [108]
but if you had used a number that had an 8 or 9 you wouldn't have seen this problem since that neither 8 nor 9 is an octal digit.
0154 is octal. 1*64 + 5*8 + 4 = 108.
its octal number. octal=0154 & decimal is=108
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