polyfill for Array.prototype.indexOf