how to use continue in jquery each loop



Answers

$('.submit').filter(':checked').each(function() {
    //This is same as 'continue'
    if(something){
        return true;
    }
    //This is same as 'break'
    if(something){
        return false;
    }
});
Question

In my application i am using ajax call.I want to use break and continue in this jquery loop.

 $('.submit').filter(':checked').each(function() {

});



return or return false are not the same as continue. If the loop is inside a function the remainder of the function will not execute as you would expect with a true "continue".






Related