Rating Credit Scores: Exercise
Explore how to classify credit scores into categories like excellent, good, fair, and poor using RamdaJS. This exercise helps you practice functional patterns in a point-free style while applying what you've learned about pure functions and currying.
We'll cover the following...
We'll cover the following...
Given a list of credit scores, return a list of reviews.
If the score’s at or above 800, return “{score} is excellent!”
If the score’s at or above 700, return “{score} is good”
If the score’s at or above 650, return “{score} is fair”
If the score’s at or below 649, return “{score} is poor”
Usage
const ratings = [740, 550, 681, 805];
getCreditScoreRatings(ratings);
// ['740 is good', '550 is poor', ' 681 is fair', '805 is excellent!']
Your solution must be point-free.