I am using the $.grep() function http://docs.jquery.com/Utilities/jQuery.grep
$.each($.grep( [0,1,2], function(n,i){
return n > 1;
}),
function(){ alert(items matched); // do something }
);
How to alert the no. of items that were matched in the alert box? Also how to avoid checking the count on each loop?