sortedIndex
Finds the lowest index at which a value should be inserted into an array in order to maintain its sorting order.
- Loosely check if the array is sorted in descending order.
- Use
Array.prototype.findIndex()
to find the appropriate index where the element should be inserted.