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
var yourName = ""; | |
var gender = "MALE"; | |
var result; | |
//Line 10 starts an if statement | |
//Nested in this if statement is an if else statement on lines 11 - 15 | |
//This nested if else statement allows us to check another condition | |
//We close the first if statement at the start of line 16 | |
if (yourName.length > 0) { | |
if (gender.lower() == "male" || gender.lower() == "female") { | |
result = "Thanks"; | |
} else { | |
result = "Please enter male or female for gender."; | |
} | |
} else { | |
result = "Please tell us both your name and gender."; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment