Home
<!DOCTYPE html> <html> <body> <h1>Demo: combined switch cases</h1> <script> var a = 2; switch (a) { case 1: case 2: case 3: alert("case 1, 2, 3 executed"); break; case 4: alert("case 4 executed"); break; default: alert("default case executed"); } </script> </body> </html>
Result: