-
-
Save atmoz/855ee294635ab1e649fe to your computer and use it in GitHub Desktop.
if-else-nesting-hell
This file contains 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) { | |
do A | |
if (b) { | |
do B | |
if (c) { | |
do C | |
} | |
else { | |
return "No C for you!" | |
} | |
} | |
else { | |
return "No B for you!" | |
} | |
} | |
else { | |
return "No A for you!" | |
} |
This file contains 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) { | |
return "No A for you!" | |
} | |
if (!b) { | |
return "No B for you!" | |
} | |
if (!c) { | |
return "No C for you!" | |
} | |
do A | |
do B | |
do C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if (!a) {
return "No A for you!"
}
do A
if (!b) {
return "No B for you!"
}
do B
if (!c) {
return "No C for you!"
}
do C