Why did we use these examples? Do we have to remember these peculiarities all the time? Well not really. In fact, these tricky things will gradually become familiar over time, but there’s a solid way to avoid trouble with them:
Process any comparison with undefined/null except strict equality
with exceptional care.
Do not use comparisons
>= > < <=
with a variable that can be null/undefined unless you’re really sure what you’re doing. If a variable can have these values, check them separately.