I. Judgment statement (PS: In general, the judging condition should ultimately be a Boolean value.) )
1.if statements
1) Basic format
if (judging condition) {The statement executed if the condition is determined}else{The statement executed if the condition is not established}
2) Extended format (two-way selection statement)
if (judging condition) {The statement executed if the condition is determined}else{The statement executed if the condition is not established}
3) Extended Format 2
if (condition 1) { The statement executed immediately if condition 10%}else if (condition 2) { If the preceding conditions are not true, condition 20% executes immediately}...else{the statement executed when all conditions are not true}
Two. Multi-path Selection statement switch
Switch (judging value) {Case comparison value 1: when the judgment value equals to the ratio 1 o'clock execution of the statement; break; Case Comparison Value 2: when the judgment value equals to the ratio 1 o'clock execution of the statement; break; .... Default: statements executed when all judgments are not equal to the value of the comparison}
Three. Looping statements
1.for Cycle
for (initialize; loop condition; statement executed after Loop) { statement executed when loop condition is set}
2.while Cycle
while (loop condition) { The statement executed when the loop condition is established;}
3.do...while Cycle
do{ When a loop condition is established, the statement}while (loop condition) is first cycled without conditional judgment. At any rate, the Loop statement executes at least once.
Four. Break statement: Exits from the current function and returns a value from that function
Five. Continue statement: Stop the current loop of the loop
Six. Return statement: Exit from the current function and return a value from that function
JS Basic (c) statement