Polyfill isArray and indexOf array methods