Switch Statement

The JavaScript Switch Statement

Execute one block of code determined by the input parameter.

switch(parameter)
{
case 1:
   execute code block 1
   break;
case 2:
   execute code block 2
   break;
default:
   run this code block if no matching block
}

Comments are closed.