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.
break
if
if/else if/else
Does that make sense?
Yes it does. Thank you very much.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey Anusionwu,
The
break
statement will end the execution of the switch statement. Without it, every condition will be checked (similar to having multipleif
statements instead of anif/else if/else
statement.Does that make sense?
Yes it does. Thank you very much.