Hello Friends 👋,

Welcome To Infinitbility! ❤️

Javascript provides a typeof keyword to check variable dataType and undefined is also a data type, and it means variable declare but not assign any value on it.

Now we are going to learn how can we check value is undefined but hear provided solution will work on any browser and any javascript frameworks like react, react native, due, node, demo, Gatsby, next and etc.

Using javascript typeof we are able to verify and handle undefined value we only check typeof of variable if the variable is not defined anywhere in code then typeof return “undefined” seems easy?

Let understand with code example

if (typeof name === "undefined") {...}

Plus point is it’s best practice to detect “undefined” value.

Thanks for reading.