Duration: 19 minutes
Summary: In this video, we illustrate the use of the switch statement. When working with conditional code, you might end up with multiple if/else if/else statements. It is better to change those into a case statement. You handle different category in its own case block. Then, you break out of the case. Otherwise, you will fall into the next case, which is most likely not what you intended. In our example, we will prompt the user for his status so we can determine the tax rate. For every status there is a case for a tax rate. At the end of the switch statement, there is a default case that handles an unexpected status. Finally, we show off the use of "arguments.length" that determines the number of arguments for a function.Methodology of the development of example: .