The difference between break and continue in JavaScript

Source: Internet
Author: User

1.break: Jump out of the loop.

2.continue: Skips an iteration in the loop. (Iteration: The sliding of the repetitive feedback process, which is intended to approximate the desired target or result.) Each repetition of a process is called an iteration, and the result of each iteration is the initial value for the next time. Personal understanding: Just want to eat apples, the apple is finished eating is the purpose, the process is a mouthful eat. One bite is an iteration until the end of the meal is finished. )

1.break (Legend):

  

The value of output A is: a = 15. i = 0,1,2,3,4,5.

2.continue (Legend):

  

The value of output A is: A = 40. i = 0,1,2,3,4,6,7,8,9.

The difference between break and continue in JavaScript

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.