_.sortedLastIndexOf

_.sortedLastIndexOf(array, value)

This method is like _.lastIndexOf except that it performs a binary search on a sorted array.

Since

4.0.0

Arguments

  1. array (Array): The array to inspect.
  2. value (*): The value to search for.

Returns

(number): Returns the index of the matched value, else -1.

Example

_.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
// => 3
doc_Lodash
2016-11-27 16:40:35
Comments
Leave a Comment

Please login to continue.