Skip to content

Instantly share code, notes, and snippets.

@latentflip
Forked from jackfranklin/gist:4731766
Last active December 12, 2015 06:49
Show Gist options
  • Save latentflip/4731793 to your computer and use it in GitHub Desktop.
Save latentflip/4731793 to your computer and use it in GitHub Desktop.
/***
*
* I want to execute someFunc() if the variable x is greater than 5
* how would you rewrite the below to NOT use a conditional? (EG no "if" used)
*
* **/
if(x > 5) {
someFunc():
}
// No if or no conditional?
(x > 5) && someFunc()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment