You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
454 B
20 lines
454 B
import isArrayLike from './is-array-like';
|
|
var indexOf = function (arr, obj) {
|
|
if (!isArrayLike(arr)) {
|
|
return -1;
|
|
}
|
|
var m = Array.prototype.indexOf;
|
|
if (m) {
|
|
return m.call(arr, obj);
|
|
}
|
|
var index = -1;
|
|
for (var i = 0; i < arr.length; i++) {
|
|
if (arr[i] === obj) {
|
|
index = i;
|
|
break;
|
|
}
|
|
}
|
|
return index;
|
|
};
|
|
export default indexOf;
|
|
//# sourceMappingURL=index-of.js.map
|