Learning Goals
1. Mastering loops and loops nesting
2. Print stars
3. Print 99 multiplication table
Nesting
Description
The following rules are followed when loops and loops are nested:
1. the outer layer is false when the inner layers do not execute;
2. Execute the outer layer until the inner layer is false and then return to the outer layers to execute.
Learning Goals
1. Mastering The syntax structure of the while statement
2. Mastering The application logic of the for-in statement
3. Mastering The grammar and application of do-while sentences
4. Mastering The difference between for and while
While statement
Grammar:
While(condition){
code that needs to be executed;
}
Do-while Statements
Grammar:
do{
code that needs to be executed;
}while(condition)
Note: This syntax loop must be executed at least once.
The difference between for and while
For: loop body for the number of known cycles
While: loop body for the number of unknown loops
Learning Goals
1. Mastering The application of the break statement
2. Mastering The application of contionue statements
break statement break: exit loop now
continue Statement continue: end this cycle, continue to start the next time.
JavaScript Loop Statement-6