Created
July 17, 2013 04:09
-
-
Save koshuang/6017633 to your computer and use it in GitHub Desktop.
邏輯判斷範例
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 isMale = false; | |
var age = 16; | |
if (isMale && age <= 14) { | |
console.log("Hi Boy!"); | |
} | |
else if (isMale && age > 14) { | |
console.log("Hi Man!"); | |
} | |
else if (!isMale && age <= 14) { | |
console.log("Hi Girl!"); | |
} | |
else if (!isMale && age > 14) { | |
console.log("Hi Lady!"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment