How can one verify the presence of a specific value within a given range?

                       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.

Leave a comment

Your email address will not be published. Required fields are marked *