switch

created onJanuary 9, 2024
traditional switch statement The traditional switch statement has a test expression and a switch code block. In a switch code block, only switch statements are allowed. A switch statement starts with a case label and a value or a default label, followed by a colon, followed by one or more statements; ...