Last change
on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
659 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var baseFindIndex = require('./_baseFindIndex'),
|
---|
| 2 | baseIsNaN = require('./_baseIsNaN'),
|
---|
| 3 | strictIndexOf = require('./_strictIndexOf');
|
---|
| 4 |
|
---|
| 5 | /**
|
---|
| 6 | * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
|
---|
| 7 | *
|
---|
| 8 | * @private
|
---|
| 9 | * @param {Array} array The array to inspect.
|
---|
| 10 | * @param {*} value The value to search for.
|
---|
| 11 | * @param {number} fromIndex The index to search from.
|
---|
| 12 | * @returns {number} Returns the index of the matched value, else `-1`.
|
---|
| 13 | */
|
---|
| 14 | function baseIndexOf(array, value, fromIndex) {
|
---|
| 15 | return value === value
|
---|
| 16 | ? strictIndexOf(array, value, fromIndex)
|
---|
| 17 | : baseFindIndex(array, baseIsNaN, fromIndex);
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | module.exports = baseIndexOf;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.