- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to determine if a variable is 'undefined' or 'null'?
On getting the result of the following, you can find whether a variable is null or undefined. If the result is “false”, it means the variable is null and undefined.
Here, the variable results in “True” −
<html> <body> <script> var age = 10; if(age) { document.write("True"); } else { document.write("False"); } </script> </body> </html>
- Related Articles
- How to check for 'undefined' or 'null' in a JavaScript array and display only non-null values?
- Why JavaScript 'var null' throw an error but 'var undefined' doesn't?
- MySQL query to select ENUM('M', 'F') as 'Male' or 'Female'?
- Program to find number of string we can make where 'a' can be 'a' or 'b', and 'b' remains 'b'in Python
- Is calling a female 'dear' or 'sweetie' harassment of some sort?
- What is the relation between 'null' and '0' in JavaScript?
- How to unset 'sharex' or 'sharey' from two axes in Matplotlib?
- Remove '0','undefined' and empty values from an array in JavaScript
- Update 'a' record with 'b' and 'b' with 'a' in a MySQL column (swap) with only 'a' and 'b' values?
- What is difference between '.' , '?' and '*' in Python regular expression?
- How to pass the value 'undefined' to a function with multiple parameters in JavaScript?
- Finding the sum of two numbers without using '+', '-', '/', '*' in JavaScript
- How to Use 'U' and 'L' formatters in Arduino?
- How to use wildcards like $ ('#name*'), $ ('#name%') in jQuery selectors?
- How to use the 'break' and 'next' statements in Ruby?

Advertisements