How to avoid problems on your javaScript code.
N Cee Dee
Posted on June 6, 2022
Avoid problems
Why did we go over these examples? Should we remember these peculiarities all the time? Well, not really. Actually, these tricky things will gradually become familiar over time, but there’s a solid way to avoid problems with them:
Treat any comparison with undefined/null except the strict equality
===
with exceptional care.
Don’t use comparisons
>= > < <=
with a variable which may be null/undefined, unless you’re really sure of what you’re doing. If a variable can have these values, check for them separately.
💖 💪 🙅 🚩
N Cee Dee
Posted on June 6, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
javascript Exploring Node.js: What Makes It a Powerful Choice for Server-Side Development
November 6, 2024