magarcia

Check for undefined in JavaScript

2 min read

Something that everyone that has been working with JavaScript for a while has done is checking if a variable is undefined. In this article, I explain which are the different ways that you can use for it and the differences between them.

If you’re writing JavaScript more or less regularly, at some point you’re probably faced with a situation where there was a need to check if a variable is `undefined`. But, what is the best way to d...