Possible Duplicate:
Is there a standard function to check for null, undefined, or blank variables in JavaScript?
How is a condition inside the if statement evaluated to true or false in JavaScript?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Whatever the result of the condition expression is, it is converted to a Boolean by
ToBoolean:For each data type or value, the conversion rules to a Boolean are clearly defined. So, for example,
undefinedandnullare both converted tofalse.