Skip to content

Instantly share code, notes, and snippets.

@moshekarmel1
Last active August 29, 2015 14:22
Show Gist options
  • Save moshekarmel1/62abe4a4c3b3e3ed836c to your computer and use it in GitHub Desktop.
Save moshekarmel1/62abe4a4c3b3e3ed836c to your computer and use it in GitHub Desktop.
var x;
if(x){
//this will not run because x is undefined, (kind of like null in Java)
}
x = null;
if(x){
//this will not run because x is null, even though it is defined
}
x = true;
if(x){
//this will run, because x is defined AND true
}
x = false;
if(x){
//this will NOT run, because although x is defined, its value is still false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment