Skip to content

Instantly share code, notes, and snippets.

@saqibameen
Created August 10, 2020 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saqibameen/39565b31af2a213bb6409200181dd1a2 to your computer and use it in GitHub Desktop.
Save saqibameen/39565b31af2a213bb6409200181dd1a2 to your computer and use it in GitHub Desktop.
if conditions in javascript
// 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