Skip to content

Instantly share code, notes, and snippets.

@IAMIronmanSam
Created June 12, 2017 21:03
Show Gist options
  • Save IAMIronmanSam/4a16e564939611ef5d0a2cbe354466f2 to your computer and use it in GitHub Desktop.
Save IAMIronmanSam/4a16e564939611ef5d0a2cbe354466f2 to your computer and use it in GitHub Desktop.
Check for Undefined & NULL
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