Skip to content

Instantly share code, notes, and snippets.

@atmoz
Created April 7, 2015 11:40
Show Gist options
  • Save atmoz/855ee294635ab1e649fe to your computer and use it in GitHub Desktop.
Save atmoz/855ee294635ab1e649fe to your computer and use it in GitHub Desktop.
if-else-nesting-hell
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!"
}
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
@wty0102
Copy link

wty0102 commented Dec 25, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment