My goal is to input a value and determine if it exists in an array or falls within a specified range of values within the array. I then want to retrieve the index of the lower range value.
For instance, consider the following array:
dataArr = [10, 20, 30, 50, 70, 80, 90, 100];
If
input = 22;
The desired outcome is to find and return the index of the values 20 and 30 from dataArr.