I have a rather simple question that I am pretty sure I know the answer to. Are there any functions in the prototypejs library that allow you to combine a for loop with an if statement? I was thinking a cross between invoke and each so that you would iterate through an array and do single method on it, if that returns "true" then you do something, if not you don't do anything. It seems like a very common usecase so I would assume something in some js library functions like this.
var array = {Object, Object, Object}
array.each(function(item) {
if(item.isTrue())
doSomething();
});
Currently I do it like that.