Last change
on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
600 bytes
|
Line | |
---|
1 | /**
|
---|
2 | * A specialized version of `_.indexOf` which performs strict equality
|
---|
3 | * comparisons of values, i.e. `===`.
|
---|
4 | *
|
---|
5 | * @private
|
---|
6 | * @param {Array} array The array to inspect.
|
---|
7 | * @param {*} value The value to search for.
|
---|
8 | * @param {number} fromIndex The index to search from.
|
---|
9 | * @returns {number} Returns the index of the matched value, else `-1`.
|
---|
10 | */
|
---|
11 | function strictIndexOf(array, value, fromIndex) {
|
---|
12 | var index = fromIndex - 1,
|
---|
13 | length = array.length;
|
---|
14 |
|
---|
15 | while (++index < length) {
|
---|
16 | if (array[index] === value) {
|
---|
17 | return index;
|
---|
18 | }
|
---|
19 | }
|
---|
20 | return -1;
|
---|
21 | }
|
---|
22 |
|
---|
23 | module.exports = strictIndexOf;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.