Build a Loan Qualification Checker - Step 3

Tell us what’s happening:

Hello i don’t know what i am doing wrong as the output on the console.log gives me the string "you qualify for a duplex, condo, and car loan when the correct vaule is entered and when the value is too low i get undefined please help me out.

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 (annualIncome >= 6000 && creditScore >= 700) {
      return "You qualify for a duplex, condo, and car loan.";
} else if (annualIncome >= 45000 && creditScore >= 680) {
      return "You qualify for a duplex, condo, and car loan.";
} else if (annualIncome >= 30000 && creditScore >= 650) {
      return "You qualify for a duplex, condo, and car loan.";
} else return "undefined";
}

console.log(getLoanMessage(30000, 649));
console.log(getLoanMessage(29999, 649));
console.log(getLoanMessage(30000, 650));
console.log(getLoanMessage(45000, 680));
console.log(getLoanMessage(60000, 700));

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0

Challenge Information:

Build a Loan Qualification Checker - Step 3

undefined is a primitive value, not a string.

Also, you have variables at the top you should be using for the conditionals.