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