Working with a Switch Statement

Here is an example of a switch statement in JavaScript:


				

The switch statement is a powerful tool for controlling the flow of your JavaScript code. It can be used to simplify complex if-else statements and to make your code more readable.

Task

Run the above code and experiment with the code to get used to it.

ADVERTISEMENT
ADVERTISEMENT