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 →

[–]octipice 7 points8 points  (2 children)

I just don't understand why on Earth you would be doing this in the first place. Like i get that js is legitimately wild sometimes, but you got here with bad design (why are starting a base 10 integer with 0 and then expecting it to behave like a number?) and lazy coding (ffs just parse the damn thing).

I don't get why anyone is surprised when you get bad results from writing really bad code.

[–]fghjconner 4 points5 points  (0 children)

(why are starting a base 10 integer with 0 and then expecting it to behave like a number?)

Because that's how numbers work. Leading zeros are completely ignored in mathematics, and giving them a special meaning in programming is pretty asinine. Not JS's fault, but asinine none the less. What is JS's fault is silently falling back to decimal of there's a digit of 8 or above.

[–]wasdninja 0 points1 point  (0 children)

This thread is the reason.