Skip to content

Instantly share code, notes, and snippets.

@davidhesselbom
Last active September 19, 2019 15:26
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 davidhesselbom/11a293207e50f8d03090df41d0375c2f to your computer and use it in GitHub Desktop.
Save davidhesselbom/11a293207e50f8d03090df41d0375c2f to your computer and use it in GitHub Desktop.
Or if
if (a || b) {
if (a) {
a();
}
if (b) {
b();
}
} else {
c();
}
// Alternative 1
if (a) {
a();
}
if (b) {
b();
}
if (!a && !b) {
c();
}
// Alternative 2
if (a) {
a();
}
or if (b) {
b();
}
else {
c();
}
// Another problem
if (a || b) {
if (a) {
a();
}
if (b) {
b();
}
c();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment