Created
February 28, 2022 05:47
-
-
Save jsdryan/157dfbdce00dea6e13fe33ff64c860ab 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
// Show content if first variable is ture. | |
const theBoolean = true; | |
const thing = 'the awesome thing'; | |
theBoolean && thing; // the awesome thing | |
// Judge the boolean of 'undefined', '', false | |
let userInput = ''; | |
!!userInput; // false | |
let userInput; = undefined; | |
!!userInput; // false | |
let userInput = false; | |
!!userInput; // false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment