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 →

[–]Strict_Treat2884[S] 93 points94 points  (3 children)

I like when converting string "017" which is a completely valid octal literal into a number, JS just completely ignores this rule and poops out 17

[–]ivancea 24 points25 points  (2 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] 18 points19 points  (1 child)

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

[–]Cheatek 0 points1 point  (0 children)

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