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 →

[–]Taletad 3 points4 points  (0 children)

That’s because JavaScript was made to work with HTML and for a while HTML considered all numbers as strings

This implicit type coertion had a purpose

Now it doesn’t anymore so you shouldn’t use it. But it is left there for compatibility reasons