Last active
August 29, 2015 14:22
-
-
Save moshekarmel1/62abe4a4c3b3e3ed836c to your computer and use it in GitHub Desktop.
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 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