Build a Loan Qualification Checker - Step 3

Tell us what’s happening:

Hi. I’m stuck again. error is Your getLoanMessage function should return undefined if the applicant’s annual income and credit score do not meet the requirements for a duplex loan.

Your code so far

const minIncomeForDuplex = 60000;
const minCreditScoreForDuplex = 700;

const minIncomeForCondo = 45000;
const minCreditScoreForCondo = 680;

const minIncomeForCar = 30000;
const minCreditScoreForCar = 650;


// User Editable Region


function getLoanMessage(annualIncome, creditScore) {
  if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) {
    return "You qualify for a duplex, condo, and car loan.";
  } else if (annualIncome >= minIncomeForCondo && creditScore >= minCreditScoreForCondo) {
    return "You qualify for a condo and car loan."
  } else if (annualIncome >= minIncomeForCar && creditScore >= minCreditScoreForCar) {
    return "You qualify for a car loan."
  } else {
    return "You don't qualify for any loans."
  }
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:139.0) Gecko/20100101 Firefox/139.0

Challenge Information:

Build a Loan Qualification Checker - Step 3

Hi, what have you tried to investigate?

Did you try testing what’s described? What was the result?

Thanks. I tried 4 different code checkers and tried their suggestions, but no luck.

Are you actually on Step 3? You have a lot of code there that doesn’t come until later.

Yup. Busted. I looked at someone else’s code to see if I could get any thing to work.
For Pet’s sake. I took out the rest of the code because I was going to show it to you and it passed. Think I’ve been working on Javascript too long today. :grinning_face: Also, it’s 86 degrees in house even with the air conditioner on. My brain is not at it’s best. Thanks for your help. I was probably miss a } initially.

Look at other code in order to understand it.

Don’t blindly copy it in to see if “it will pass”. You’ll never learn anything that way.

1 Like

Understood. Thank you.

1 Like