+ 3
Why should you always end IF & ELSEIF with ELSE statement?
Cant you just ask the program "if this do that if not, just ignore that this code exists". I am asking because the JS couse said: "The final else statement "ends" the else if statement and should be always written after the if and else if statements."
4 ответов
+ 2
OK it appears you have misunderstood. It doesn't mean an else statement is required. It means that the else statement if used must be the last
It means that when used else must go after the if else statements not before them.
+ 4
else same as default when you using switch statement.
+ 1
thank you. i thought that was it Josh because of python. I misunderstood the sentence and you cleared up its not different in JS
0
That's fine.