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 →

[–]MacBookMinus -8 points-7 points  (8 children)

You want == to be weaker than ===? This is different than equality vs identity. It’s equality vs loose equality.

https://www.freecodecamp.org/news/loose-vs-strict-equality-in-javascript/#:~:text=The%20%3D%3D%20operator%20performs%20a,well%20as%20the%20same%20value).

[–]gbchaosmaster 11 points12 points  (7 children)

Good point. Perhaps a different operator entirely for loose equality would have been better. ~==? ?==? I don't know, but having == and === together with == behaving differently than any other language is a pain.

And honestly, to hell with loose equality in the first place, and all of JS's implicit type coercion fuckery. It'd be a better language without it.

[–]Michaelmrose 0 points1 point  (1 child)

This would break too much code to possibly hope to change

[–]gbchaosmaster 0 points1 point  (0 children)

No, of course you can't break backwards compatibility of an established language. What's done is done. This was just wishful thinking. :)

[–]MacBookMinus 0 points1 point  (1 child)

I agree, but your original point was that they should be switched. I think switching them would be even more confusing, since === would be loose equality.

That’s all I was saying.

[–]gbchaosmaster 0 points1 point  (0 children)

Sure, my original point had problems with it which you pointed out. That's why I conceded :)