yearExp = parseFloat(yearExp);
// Loop through the ranges object to find the range for the given number
let result = Object.keys(searchResult).find(range => {
let [min, max] = range.split('-').map(parseFloat);
if (isNaN(max)) {
// Check for ranges with "+" symbol (representing greater than)
return yearExp >= min;
} else {
// Check for ranges between min and max values
return yearExp >= min && yearExp < max;
}
});
//From here check the value of result.