source: node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.js

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
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const sortedLastIndex = require('./sortedLastIndex.js');
6const isEqualsSameValueZero = require('../../_internal/isEqualsSameValueZero.js');
7
8function 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
19exports.sortedLastIndexOf = sortedLastIndexOf;
Note: See TracBrowser for help on using the repository browser.