CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
sortedLastIndexOf.js32 linesDownload Raw Back to lodash-es
1import baseSortedIndex from './_baseSortedIndex.js';2import eq from './eq.js';3 4/**5 * This method is like `_.lastIndexOf` except that it performs a binary6 * search on a sorted `array`.7 *8 * @static9 * @memberOf _10 * @since 4.0.011 * @category Array12 * @param {Array} array The array to inspect.13 * @param {*} value The value to search for.14 * @returns {number} Returns the index of the matched value, else `-1`.15 * @example16 *17 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);18 * // => 319 */20function sortedLastIndexOf(array, value) {21  var length = array == null ? 0 : array.length;22  if (length) {23    var index = baseSortedIndex(array, value, true) - 1;24    if (eq(array[index], value)) {25      return index;26    }27  }28  return -1;29}30 31export default sortedLastIndexOf;32 
basant307/AI_Governance_Project · CoolFace