Skip to content

Instantly share code, notes, and snippets.

@tripdog
Last active June 17, 2021 04:08
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 tripdog/e9d0b50a39f0564f66009360116e3571 to your computer and use it in GitHub Desktop.
Save tripdog/e9d0b50a39f0564f66009360116e3571 to your computer and use it in GitHub Desktop.
If the variable is truthy return true, else return false

If the variable is truthy, return true. If it is falsy return false.

function truthyOrFalsy(random) {
    return (random ?  "true" : "false") 
  
}
console.log(truthyOrFalsy(39))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment