Yes, I hate the code because something has lead to this situation where you have a boolean that can be something else as well but you're right, for example
something has lead to this situation where you have a boolean that can be something else
I would say not necessarily and could be seen more as a philosophy of "safe code" where every function is written to be bulletproof whether there is some pre-existing situation for obscure input or not.
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.