Is there a method in jQuery similar to retun false; in function that prevents a parent function from running?
I’ve got a system outlined below, that needs to be stopped when a value is incorrect. Along with it, the parent function needs to be stopped.
parent.each(function(){
child.each(function(){
if (true) {
//stuff
} else {
return false and cancel parent.each();
}
});
otherChild.each(function(){
if (true) {
//stuff
} else {
return false and cancel parent.each();
}
});
});
1 Answer