Mega Code Archive

 
Categories / JavaScript Tutorial / Statement
 

Switch Statement with Integer as the control variable

< html> <head> <title>Switch Statement Demo</title> <script language="javascript" type="text/javascript"> <!-- switch (2){   case "a":     alert(1);   case 2:     alert(2);   case true:     alert(3); } //--> </script> </head> <body> <h1>Switch Statement Demo</h1> </body> </html>