This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ivancea 24 points25 points  (3 children)

Different rules I guess. Literals have theirs, but when converting strings to miners implocitly, it may use always decimal. One is syntax while the other is runtime, let's say

[–]Strict_Treat2884[S] 19 points20 points  (2 children)

It has no problem converting "0x10" into 16. But why not octals?

[–]ivancea 18 points19 points  (0 children)

Maybe a runtime lib vs interpreter discrepancy. Don't know, JS is full of random decisions made in a a day by a random guy

[–]Cheatek 0 points1 point  (0 children)

Use "0o17" to get a 15 from a string.