Last active
September 19, 2019 15:26
-
-
Save davidhesselbom/11a293207e50f8d03090df41d0375c2f to your computer and use it in GitHub Desktop.
Or if
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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