I have an array that I put together in jQuery and I\'m wondering if there is a way that I could find the number of occurrences of a given term. Would I have better results i
You can probably do like this -
var myArray = ['a','fgh','dde','a3e','rra','ab','a']; var occurance = 0; var lookupVal = 'a'; $(myArray).each(function (index, value) { if(value.indexOf(lookupVal)!= -1) { occurance++; } });