+ 2
Is there a difference in using a switch statement with cases and using an else statement with else ifs ? - seems like not.
the difference is that switch is faster.
2 Réponses
+ 6
Switch allows only to branch on specific values. if else if allowed to branch on much more complex conditions
0
if you compare one or two statement use if else. but if you got more complex scenarios, switch case structure is wiser and tidy.