return false: will stop the loop (just like using 'break' in a normal loop).
return true: Jump 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() still returns a collection of objects. each(function(){}): It is a callback function. In the callback function, the result cannot be returned outside the callback function each.