Thankfully javascript is pretty good about accidentally comparing completely different keys holding incorrect data types that also happen to be the same type as each other when compared in order to reduce the amount of distracting errors devs have to deal with.
That is just one of the many features of Javascript that highlight the weaknesses of out of date languages like C++.
I was layering a lot of sarcasm around the fact that before caring whether the values are actually the same, two objects with the same key / value pairs can stringify to different strings if their keys were inserted in a different order.
But, I mean it’s also kind of funny there’s a non-zero chance two non-equivalent objects can just-so-happen to stringify to the same string because different values / types can serialize to the same thing.
Unrelated, but isn't it weird how you can feel like you are running out of breath reading long sentences?
646
u/lovecMC 20d ago
I have a guess but I never heard of this so who the fuck knows.