What’s happening here and why?
document.write(0154); // === 108
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.