Compare Revisions

Conditional Statements

Revision 118274:

Revision 118274 by Bkimman on

Revision 118275:

Revision 118275 by Frappyjohn on

Title:
Conditional Statements
Conditional Statements
Slug:
JavaScript/Guide/Obsolete_Pages/Conditional_Statements
JavaScript/Guide/Obsolete_Pages/Conditional_Statements
Content:

Revision 118274
Revision 118275
n118      In the following example, if <code>expr</code> evaluates ton118      In the following example, if <code>fruittype</code> evaluat
> "Bananas", the program matches the value with case "Bananas" and>es to "Bananas", the program matches the value with case "Bananas
> executes the associated statement. When <code>break</code> is en>" and executes the associated statement. When <code>break</code> 
>countered, the program terminates <code>switch</code> and execute>is encountered, the program terminates <code>switch</code> and ex
>s the statement following <code>switch</code>. If <code>break</co>ecutes the statement following <code>switch</code>. If <code>brea
>de> were omitted, the statement for case "Cherries" would also be>k</code> were omitted, the statement for case "Cherries" would al
> executed.>so be executed.
n121switch (expr) {n121switch (fruittype) {
t135      document.write("Sorry, we are out of " + i + ".&lt;br&gt;")t135      document.write("Sorry, we are out of " + fruittype + ".&lt;
>;>br&gt;");

Back to History