Created
June 12, 2017 21:03
-
-
Save IAMIronmanSam/4a16e564939611ef5d0a2cbe354466f2 to your computer and use it in GitHub Desktop.
Check for Undefined & NULL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ironman; | |
if(ironman){ // Check Declaration | |
console.log('Defined and has value'); | |
} | |
if(!ironman){ // Check for null | |
console.log('Defined and has null value'); | |
} | |
if(!!ironman){ //Check for Null & Defined | |
console.log('Defined and not empty'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment