JavaScript Loop Statement-6

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.