--What is an if statement? ** If the conditions are not met, do nothing ** A statement that can omit ** else ** if the result is ** false ** and nothing is done.
if ("Conditional expression"){
//Block 1
}
--if-else What is the if-else syntax? ** If the conditions are not met, I would like to evaluate under different conditions ** ** if-else if-else syntax with a block starting with else if inserted before else **
if ("Conditional expression 1"){
//Block 1
} else if ("Conditional expression 2"){
//Block 2
} else if ("Conditional expression 3"){
//Block 3
} else {
//Last block
}
The if-else if-else syntax can branch into three or more routes in one statement. There are two rules in this syntax. One is that the else if block ** can be described multiple times **, but ** after the if block **, ** Can only be written before the else block **.
I have only written two types yet, but that's all for today ... There are a lot of things to sort out, but from tomorrow I'll try to update it a little earlier. I'm busy, so I'm afraid I'll be depressed, but I'll do my best to continue studying! About the switch syntax that I didn't use this time tomorrow! I will write this as well.
Recommended Posts