Created
August 10, 2020 07:16
-
-
Save saqibameen/39565b31af2a213bb6409200181dd1a2 to your computer and use it in GitHub Desktop.
if conditions in javascript
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
// 0 and '' are evaluated to false in JS. | |
let x = 0; | |
if(x) { | |
... | |
} else { | |
// Will come here | |
} | |
let str = ''; | |
if(str) { | |
... | |
} else { | |
// Will come here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment