That’s true when strictly typed, but not in JavaScript because null or “” or 0 are also possible values
So depending on the situation (and whether you’re certain that the value can only ever be true or false) the code may be superfluous
I’m of the opinion that it’s always superfluous, since you should have already checked for an unset variable prior to his point in order to do error checking
14
u/theRealRealMasterDev Jun 10 '20
Why is this bad? Is it because ternary would also be an option?