Your talking about Java, not Javascript right? I think the command count_if. But I'm not sure, I'm not exactly a Java expert =P