DEV Community

[Comment from a deleted post]
Collapse
 
ozzyogkush profile image
Derek Rosenzweig

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!

Collapse
 
qm3ster profile image
Mihail Malo

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.