Polyfill Array.indexOf, use loops over forEach