Skip to content

Instantly share code, notes, and snippets.

@jw-jenrise
Created January 24, 2018 12:00
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 jw-jenrise/f753a6a6403cbc536e027e29f6428a27 to your computer and use it in GitHub Desktop.
Save jw-jenrise/f753a6a6403cbc536e027e29f6428a27 to your computer and use it in GitHub Desktop.
console.log("Begin example - 3");
var p = 0; // Try replacing this with null, undefined, NaN
console.log("Value of p = " + p);
console.log("Boolean equivalent of p = " + Boolean(p)); // Truthy or Falsy value
// Example usage of truthy or falsy
if (p){
console.log("I am happy");
} else {
console.log("I am not sure");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment