Switch Statement with Integer as the control variable : Switch : Statement JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Statement » Switch »

 

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>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Statement
» Switch