Jquery $. each and

Source: Internet
Author: User
In jquery, how does one terminate this loop or exit the loop? I found a good method after searching. You may wish to refer to it and hope it will help you to terminate this loop or jump out of the loop in jquery? Check some information and try to find the following method:

1. In the for loop, we use continue. Terminating this loop is included in the next loop, and using break to terminate the entire loop.
2. In jquery, $. each uses return true and return false.

Break can jump out of the switch... case statement and continue executing the content after the switch statement. The break statement can also jump out of the loop, that is, end the execution of the loop statement.

The function of the continue statement is to end this loop, and then judge whether to execute the next loop.

The difference between continue and break is that break completely ends the loop, while continue ends the loop.
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.