Update sortedIndex.md

This commit is contained in:
Angelos Chalaris
2017-12-31 17:05:50 +02:00
committed by GitHub
parent a8286a4943
commit 3bb78b0cfd

View File

@ -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) => {