Skip to content

Instantly share code, notes, and snippets.

Created Jan 24, 2018
What would you like to do?
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