The "correct" way would be for ECMA group to abstract this gotcha into an override of the == and/or === operators for floats in an upcoming version of ES :D... but good tip!
That would certainly be breaking.
I feel like I wouldn't mind them doing that to ==, which means "approximately equal" in my head, but in reality that would become a reason to use == with all its coercions and we definitely don't need that.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
The "correct" way would be for ECMA group to abstract this gotcha into an override of the == and/or === operators for floats in an upcoming version of ES :D... but good tip!
That would certainly be breaking.
I feel like I wouldn't mind them doing that to
==
, which means "approximately equal" in my head, but in reality that would become a reason to use==
with all its coercions and we definitely don't need that.