Skip to content

Instantly share code, notes, and snippets.

@siriniok
Created November 25, 2017 11:28
Show Gist options
  • Save siriniok/e87e63ae46f7342faa696b89ceec3aa4 to your computer and use it in GitHub Desktop.
Save siriniok/e87e63ae46f7342faa696b89ceec3aa4 to your computer and use it in GitHub Desktop.
Ternary Formatting
return done ? foo(a) : bar(b);
return done == false && exist == true
? foo(a)
: bar(b);
const baz = (a, b) =>
done ? foo(a) : bar(b);
const baz = (a, b) =>
done == false && exist == true
? foo(a)
: bar(b);
const result = done ? foo(a) : bar(b);
const result =
done == false && exist == true
? foo(a)
: bar(b);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment