sorted-index-of

v4.17.15arrow_drop_down
v4.17.15
v4.17.11
STATUS
Passing
DOWNLOADS
131
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
This method is like `_.indexOf` except that it performs a binary search on a sorted `array`.
2 contributors
Install sorted-index-of as a package?
Copied
npm i @bit/lodash.lodash.sorted-index-of
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
sortedIndexOf (
array:Array,
value:*
) : number

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

Example
sortedIndexOf([4, 5, 5, 5, 6], 5)
// => 1
Arguments
array: Array

The array to inspect.

value: *

The value to search for.

Returns
number

Returns the index of the matched value, else `-1`.

Help and resources