How to check a not-defined variable in JavaScript?



To check a variable is ‘undefined’, you need to check using the following. If the result is “false”, it means the variable is not defined. Here, the variable results in “True” −

Example

Live Demo


   
      
   
Updated on: 2020-06-15T05:26:32+05:30

240 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements