Skip to content

Instantly share code, notes, and snippets.

@JakeSidSmith
Created March 15, 2015 05:13
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 JakeSidSmith/87b2c1422d514109a595 to your computer and use it in GitHub Desktop.
Save JakeSidSmith/87b2c1422d514109a595 to your computer and use it in GitHub Desktop.
Messing around with potentially nicer ways to write ternaries
var ternary = function (bool, success, fail) {
return bool ? success : fail;
};
var message = ternary(true, 'Hello', ternary(true, 'Werld', 'World'));
console.log(message);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment