Update sortedIndex.md
This commit is contained in:
@ -1,6 +1,9 @@
|
|||||||
### sortedIndex
|
### sortedIndex
|
||||||
|
|
||||||
Returns the lowest index at which value should be inserted into array in order to maintain its sort order
|
Returns the lowest index at which value should be inserted into array in order to maintain its sort order.
|
||||||
|
|
||||||
|
Check if the array is sorted in descending order (loosely).
|
||||||
|
Use `Array.findIndex()` to find the appropriate index where the element should be inserted.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const sortedIndex = (arr, n) => {
|
const sortedIndex = (arr, n) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user