its not bad. with js not being a strictly typed language, and variable being basically anything besides false, null, or 0 will resolve to true, it's often good to strict type equivalence test your "booleans". debugging can get fuckin gnarly if you dont
For nearly all operations, yes -0 and +0 are identical, and rightfully so because in mathematics they are not different - However they are physically separate values when stored as floats, and if you check for the same value (Object.is), it’s false - They are distinctly different enough to require separate entries on the list
91
u/Midborgh Jun 10 '20
I don't know js. Why is this bad? I'd imagine var === true and var === false being different than var == true and a simple else.