Skip to content

Instantly share code, notes, and snippets.

@ultim8k
Last active December 18, 2015 18:10
Show Gist options
  • Save ultim8k/5824131 to your computer and use it in GitHub Desktop.
Save ultim8k/5824131 to your computer and use it in GitHub Desktop.
Set value of a var based on condition (the lazy way)
/**
* Set value of a var based on condition
*/
var enabled = (true) ? "YES" : "NO" // YES
var status = (enabled == "YES") ? "ENABLED" : "DISABLED" // ENABLED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment