Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rwilcox
Created September 4, 2014 16:39
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 rwilcox/da5dcd326c767b561559 to your computer and use it in GitHub Desktop.
Save rwilcox/da5dcd326c767b561559 to your computer and use it in GitHub Desktop.
myF = () ->
true
formattedOutput =
full_name: "Ryan Wilcox"
username: "rwilcox"
needs_profile_update: myF() ? "YES" : "NO"
# ^^^ generates (_ref = myF()) != null ? _ref : {"YES": "NO"}
# Ummm... that's odd...
console.log formattedOutput
# ########
console.log "####################"
formattedOutput =
full_name: "Ryan Wilcox"
username: "rwilcox"
needs_profile_update: if myF() then "YES" else "NO"
# ^^^ LITERALLY generates myF() ? "YES" : "NO"
console.log formattedOutput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment