⭐ Reply with correct answer & Bonus points for explanation ⚡
💡 Correct answer with detailed explanation will be updated in comments after 48 hours.
Code -
console.log((055-35)-5);
For further actions, you may consider blocking this person and/or reporting abuse
AnhChienVu -
Mohammad Jawad (Kasir) Barati -
Natália Catunda -
Leo Scott -
Top comments (4)
It can't be
15
as one would intuitively think. So, thinking what kind of wrong thing javascript could do, I'm guessing the leading zero is treated as some kind of literal prefix that changes the base of the number. Fives wouldn't be valid for binary, so possibly hex, which would make55
actually equal to decimal85
and the final answer45
.But that would still be too logical, as hex is generally useful, so I'm guessing it isn't hex, but a less used base... so maybe base 12 or 8. I can't think of the name for base 12, but octal has a simple name and isn't very useful, so I'm going to guess that it's octal.
Then octal
055
actually equals decimal45
and the result is45 - 35 - 5 == 5
.Your answer is correct and Your guessing game is on point. Getting kind of Sherlock Holms vibess .....
5
That's absolutely Correct !!!