Created
November 28, 2016 22:50
-
-
Save aledwassell/2c9b886fe59d430a04ec87fa03c1290d 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 a; | |
a = 1; | |
// if | |
// a = null; | |
// a = ""; | |
// a = undefined | |
// using coersion to check if something has a value that isn't null, and empty string or undefined. | |
if (a) { | |
console.log("There is something there."); | |
} else { | |
console.log("There is nothing there"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment