Options
All
  • Public
  • Public/Protected
  • All
Menu

Module sortedIndexBy

Index

References

Functions Array

References

Renames and re-exports __type

Array Functions

  • sortedIndexBy<T>(array: T[], value: T, iteratee: ArrayIteratee<T, number>): number
  • This method is like sortedIndex except that it accepts iteratee which is invoked for value and each element of array to compute their sort ranking. The iteratee is invoked with one argument: (value).

    since

    5.11.0

    example
    const objects = [{ 'n': 4 }, { 'n': 5 }]

    sortedIndexBy(objects, { 'n': 4 }, ({ n }) => n)
    // => 0

    Type parameters

    • T = any

    Parameters

    • array: T[]

      The sorted array to inspect.

    • value: T

      The value to evaluate.

    • iteratee: ArrayIteratee<T, number>

      The iteratee invoked per element.

    Returns number

    Returns the index at which value should be inserted into array.