Created
February 14, 2012 01:32
-
-
Save ashryanbeats/1822336 to your computer and use it in GitHub Desktop.
Conditionals in Javascript 2.6
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
var yourName = "Ash"; | |
var gender = "Blue"; | |
var result; | |
if (yourName.length > 0 && gender.length > 0) { | |
if (gender === "Male" || gender === "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