DEV Community

Discussion on: What is a switch statement?

Collapse
 
devdrake0 profile image
Si

Hey Anusionwu,

The break statement will end the execution of the switch statement. Without it, every condition will be checked (similar to having multiple if statements instead of an if/else if/else statement.

Does that make sense?

Collapse
 
anusionwuchikel profile image
Anusionwu Chikeluba George

Yes it does. Thank you very much.