jquery $.each and for how to jump out of the loop to terminate this cycle

Source: Internet
Author: User
Tags case statement

How do I stop this loop or jump out of a loop in a loop in jquery? Look up some information and try to find the following method

1. For loop we use continue; terminate this loop to count to the next loop, 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 proceed to the contents after the switch statement. The break statement can also jump out of the loop, that is, to end the execution of the loop statement.

The function of the continue statement is to end the loop, and then the next time the loop is executed.

The difference between continue and break is that break is the complete end of the loop, and continue is the end of the cycle

Originating From: http://www.jb51.net/article/41746.htm

jquery $.each and for how to jump out of the loop to terminate this cycle

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.