Back to lesson
1. What does Switch allow us to test?
2. Why might you use a Switch instead of if/else?
If you have many things (cases) to test.
When you need to do math.
If you like them better than if/else statements.
3. Why don't we need to "break" the default case?
Because default handles errors differently.
Because default is special.
Because it is last, the code will break because its at the end.
Back to the top
© 2017 GoSkills Ltd.
Skills for career advancement