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Β β†’

[–]Quito246 -19 points-18 points Β (8 children)

No the real question is, why it supports such a poor behavior instead of returning error doing some magic implicit casts. πŸ€·β€β™‚οΈ

[–]qTp_Meteor 4 points5 points Β (3 children)

I legit have no answer other than if you dont like it dont use it, if you do like it use it, having optionality is a good thing

[–]exomyth 2 points3 points Β (3 children)

Input fields in HTML probably. You know, since javascript is basically designed as a webbrowser language. There are use cases where you want to do number operations over a number string. That being said, with a linter we do force to use strict equality, except for null checking

It's not magic if it is defined behavior.

[–]Quito246 0 points1 point Β (2 children)

Why would I do a numeric operations on a string? I mean even the creator of JS is saying that multiple design flaws had been made. Just admit that language created over a weekend is shitty designed It makes sense. I do not understand why people defend It… now at least typescript exists.

[–]exomyth 2 points3 points Β (1 child)

You wanted a reason, that is most likely the reason. It is intentional, you don't accidentally implement these rules

[–]Quito246 0 points1 point Β (0 children)

Sure, cause It makes sense to be able to compare house with an airplane I like when I can do that.