How to fix Array indexOf() in JavaScript for Internet Explorer browsers

Do it like this…

if (!Array.prototype.indexOf) {

}

As recommended compatibility by MDC.

In general, browser detection code is a big no-no.

Leave a Comment