Return false: Will stop the loop (just like using ‘break’ in a normal loop). Return true: Skip to the next loop (just like using ‘continue’ in a normal loop).
function test(){
var success = false;
$(..).each(function () {
if (..) {
success = true;
return false;
}
});
return success ;
}
Jquery is an object chain, so $(..) .each() returns a collection of objects. Each (function(){}) : is a callback function, in the callback function cannot return the result to the callback function outside of each.