The switch statement is used to select one of many code blocks to be executed. It is an excellent and
more readable alternative to long if...else if...else structures when checking the same variable
against multiple different values.
EXAMPLE
RESULT
We use cookies to ensure a better user experience and website functionality.