I'm running into an IE8 issue which I initially thought was due to lack of IE8 support for indexOf() property but that didn't seem to be the case. I implemented the indexOf() through prototype but still keep getting the error messsage -
Object doesn't support property or method 'filter'
My code is and it errors out on the passedArray.filter line.
function consolidatedFilters(passedArray, passedFilter, passedFilterType)
if (passedFilterType == "specialty")
{
var filteredArray = passedArray.filter(
function(el)
{
for (i in passedFilter)
{
if (passedFilter[i] == el[8])
{
return true;
}
}
return false
}
);
return filteredArray;
}
Array.filter isn't cross-browser compliant, you'll have to prototype that onto Array. You also may want to verify that the array you are filtering is never typeof 'undefined'
Update: MDN provides a reference to how to prototype filter onto array: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/filter
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With