Please consider the following function body:
var isValidated = true;
$(selector1).each(function(){
//do validation with local f()...
isValidated = f() && isValidated;
});
$(selector2).each(function(){
//do validation with local f()...
isValidated = f() && isValidated;
});
$(selector3).each(function(){
//do validation with local f()...
isValidated = f() && isValidated;
});
return isValidated;
My description of the progress of isValidated
is Boolean concatenation---but there has to be an official, computer-science term for this thing. What is it? To clarify, the idea here is to let each $()
block run---but when any one of these blocks have a validation failure the results of this failure must return false
over all blocks (true && true && false == false
). So, like many programmers, I am using some kind of a pattern but we often don't know what it is called. So does this pattern resemble anything useful?