UNPKG

polyfill-service

Version:
1 lines 1.33 kB
{"aliases":["default","es5","modernizr:es5array","blissfuljs"],"browsers":{"ie":"6 - 8"},"spec":"http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.indexof","docs":"https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf","baseDir":"Array/prototype/indexOf","hasTests":true,"rawSource":"\n// Array.prototype.indexOf\nArray.prototype.indexOf = function indexOf(searchElement) {\n\tif (this === undefined || this === null) {\n\t\tthrow new TypeError(this + 'is not an object');\n\t}\n\n\tvar\n\tarraylike = this instanceof String ? this.split('') : this,\n\tlength = Math.max(Math.min(arraylike.length, 9007199254740991), 0) || 0,\n\tindex = Number(arguments[1]) || 0;\n\n\tindex = (index < 0 ? Math.max(length + index, 0) : index) - 1;\n\n\twhile (++index < length) {\n\t\tif (index in arraylike && arraylike[index] === searchElement) {\n\t\t\treturn index;\n\t\t}\n\t}\n\n\treturn -1;\n};\n","minSource":"Array.prototype.indexOf=function(t){if(void 0===this||null===this)throw new TypeError(this+\"is not an object\");var i=this instanceof String?this.split(\"\"):this,n=Math.max(Math.min(i.length,9007199254740991),0)||0,r=Number(arguments[1])||0;for(r=(0>r?Math.max(n+r,0):r)-1;++r<n;)if(r in i&&i[r]===t)return r;return-1};","detectSource":"'indexOf' in Array.prototype"}