Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

switch Multiple-Selection Statement

• JavaScript provides the switch multiple-selection when an algorithm will contain a


series of decisions in which a variable or expression is tested separately for each of the
values it may assume, and different actions are taken for each value.
• The script in Fig. 8.7 demonstrates three different CSS list formats determined by the
value the user enters.
switch Multiple-Selection Statement
switch Multiple-Selection Statement
switch Multiple-Selection Statement
switch Multiple-Selection Statement
• Flowcharting the switch Statement
• The general switch statement (i.e., using a break in each case) is flowcharted in Fig. 8.8.
do…while Repetition Statement
• The do…while statement tests the loop-continuation condition after the loop body
executes—therefore, the loop body always executes at least once.
• The script in Fig. 8.9 uses a do…while statement to display each of the six different
HTML5 heading types (h1 through h6)
do…while Repetition Statement
do…while Repetition Statement
do…while Repetition Statement
• Flowcharting the do…while Statement

You might also like