Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:29:12+00:00 2026-05-27T13:29:12+00:00

Imagine that I want to loop over a list of jQuery objects, and for

  • 0

Imagine that I want to loop over a list of jQuery objects, and for each of them execute some functions. However, if in some place, a criteria is not met, then I simply want to continue; to other objects. The simple pseudo-code might be something like:

$('#element').each(function(){
    // some code here
    if (!$(this).is('.included')) {
       continue; // This keyword of course, doesn't work here
    }
    // more code here, which won't get executed for some elements
});

I wan to achieve the same effect as:

for (var i = 0; i < 10; i++) {
    if (i % 2 == 0 ) {
        continue;
    }
    console.log(i);
}

I know that I can return false; somewhere inside each(); method, to completely break the looping. But I don’t want to break looping. I only want to skip some elements. I also know that I can use if-else blocks to skip elements, but is there a more neat way to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:29:12+00:00Added an answer on May 27, 2026 at 1:29 pm

    simply use return; instead of continue; (not return false;).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm defining some types via System.Reflection.Emit. Imagine that I want to have method signature
I want to routinely do something using PHP. For example, imagine that each 5
Imagine that you want to develop a non-trivial end-user desktop (not web) application in
Imagine that I want to create an array from another array like this: $array
Imagine that you want to send any Serializable class to the client side of
Let's imagine I want to make a templated function that returns the first element
I want to create a helper method that I can imagine has a signature
I have a loop of intensive calculations, I want them to be accelerated using
I want to animate some multiple objects sequentially. As in, one animation should happen
I have a list that I want to be able to store 20 values.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.