switchudtryk
A switch statement, often referred to as a switch-case statement or switch-expression, is a control flow statement that allows for a variable to be tested for equality against a list of values. When a match is found, the block of code associated with that value is executed. If no match is found, an optional default block of code can be executed. This construct provides a more readable and sometimes more efficient alternative to a series of nested if-else if statements when dealing with multiple discrete possibilities.
The syntax typically involves the keyword `switch` followed by an expression or variable in parentheses. Inside