Introduction
In this lab, we will be exploring the concept of finding the last insertion index in a sorted array. We will learn how to check if the array is sorted in descending order and how to use Array.prototype.reverse()
and Array.prototype.findIndex()
to find the appropriate last index where the element should be inserted. By the end of this lab, you will have a better understanding of how to maintain the sort order of an array.