123456789101112131415161718192021222324252627282930313233343536373839404142 |
- var baseIndexOf = require('./_baseIndexOf'),
- toInteger = require('./toInteger');
- var nativeMax = Math.max;
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseIndexOf(array, value, index);
- }
- module.exports = indexOf;
|