I need to get errorIdx = 3, but I get 0. How can I loop through array from its end?
const scrollPosition = 5007
const errorsHeight = [947, 2498, 3495, 4805, 5755]
errorIdx = errorsHeight.findIndex((itemHeight: number) => itemHeight < scrollPosition)
console.log(errorIdx) // 0