CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
sortedLastIndexBy.js34 linesDownload Raw Back to lodash
1var baseIteratee = require('./_baseIteratee'),2    baseSortedIndexBy = require('./_baseSortedIndexBy');3 4/**5 * This method is like `_.sortedLastIndex` except that it accepts `iteratee`6 * which is invoked for `value` and each element of `array` to compute their7 * sort ranking. The iteratee is invoked with one argument: (value).8 *9 * @static10 * @memberOf _11 * @since 4.0.012 * @category Array13 * @param {Array} array The sorted array to inspect.14 * @param {*} value The value to evaluate.15 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.16 * @returns {number} Returns the index at which `value` should be inserted17 *  into `array`.18 * @example19 *20 * var objects = [{ 'x': 4 }, { 'x': 5 }];21 *22 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });23 * // => 124 *25 * // The `_.property` iteratee shorthand.26 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');27 * // => 128 */29function sortedLastIndexBy(array, value, iteratee) {30  return baseSortedIndexBy(array, value, baseIteratee(iteratee, 2), true);31}32 33module.exports = sortedLastIndexBy;34 
basant307/AI_Governance_Project · CoolFace