|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
576 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const sortedLastIndex = require('./sortedLastIndex.js');
|
|---|
| 6 | const isEqualsSameValueZero = require('../../_internal/isEqualsSameValueZero.js');
|
|---|
| 7 |
|
|---|
| 8 | function sortedLastIndexOf(array, value) {
|
|---|
| 9 | if (!array?.length) {
|
|---|
| 10 | return -1;
|
|---|
| 11 | }
|
|---|
| 12 | const index = sortedLastIndex.sortedLastIndex(array, value) - 1;
|
|---|
| 13 | if (index >= 0 && isEqualsSameValueZero.isEqualsSameValueZero(array[index], value)) {
|
|---|
| 14 | return index;
|
|---|
| 15 | }
|
|---|
| 16 | return -1;
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | exports.sortedLastIndexOf = sortedLastIndexOf;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.