Let's say I have the following code:
function check(code){
var result=false;
$.each(arrayOfFunctions,function(){
thisresult=this.call(this,code);
if (thisresult==true){
result=true;
}
});
return result;
}
So I have a function with one input. I have an array of functions that I apply to that data. If any of them are true, the outer function is true.
When I'm in the inner function, is there a way to return on the outer function? Are there any other optimizations that can be done to my code?
function() { return !(result = this.call(this, code)); }