I have such code:
function allValid() { $(\'input\').each(function(index) { if(something) { return false; } });
Yeah, store it in a local variable.
function allValid() { var allGood = true; $('input').each(function (index) { if (something) { allGood = false; } }); return allGood; }