6.1 ① A Condition Statement is called a control flow in a script. ② Although JavaScript does not support the "elseif" keyword, it is allowed to create such statements through the IF/else statement chain. ③ The break statement is also used for the default item in the switch Condition Statement, because if it is not at the end, the subsequent case will still be executed. ④ If there is no default in case, and it is not the last one, it is called fall through (fail) ⑤ conditional operator (also called ternary operator ):
6.2 The prompt box shows the user input:
VaR username = Window. Prompt ("Give me your name! "," Default display content ");
6.5 loop: ① do while loop is a special case, because even if the comparison statement in the loop returns false for the first time, the code will be executed at least once. ② The for in loop allows you to traverse the names of all attributes in the object, while the for each in loop allows you to traverse the values of each attribute. These Chapter 8 details.
Chapter 6-conditional statements and loops