Merged post - Build a Loan Qualification Checker - Step 4

Tell us what’s happening:

function getLoanMessage(annualIncome, creditScore) {
if (
annualIncome >= minIncomeForCondo &&
creditScore >= minCreditScoreForCondo
) {
return “You qualify for a condo and car loan.”;
}
}

Your code so far

const minIncomeForDuplex = 60000;
const minCreditScoreForDuplex = 700;

const minIncomeForCondo = 45000;
const minCreditScoreForCondo = 680;

const minIncomeForCar = 30000;
const minCreditScoreForCar = 650;

function getLoanMessage(annualIncome, creditScore) {
  if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) {
    return "You qualify for a duplex, condo, and car loan."

// User Editable Region

  } 
  function getLoanMessage(annualIncome, creditScore) {
  if (
    annualIncome >= minIncomeForCondo &&
    creditScore >= minCreditScoreForCondo
  ) {
    return "You qualify for a condo and car loan.";
  }
}


}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build a Loan Qualification Checker - Step 4

Welcome to the forum @saniyaSiddiqui!

As you’re working through the steps in a workshop, please pay careful attention to where you are asked to write the code. The function getLoanMessage has already been defined and you are being asked to write more code inside it. To get you back to where you need to be, please reset this step to restore the original code, then try again.

Tell us what’s happening:

function getLoanMessage(annualIncome, creditScore) {
if (
annualIncome >= minIncomeForCondo &&
creditScore >= minCreditScoreForCondo &&
annualIncome >= minIncomeForCar &&
creditScore >= minCreditScoreForCar
) {
return “You qualify for a condo and car loan.”;
}
return undefined; // Explicitly return undefined if not qualified
}

Your code so far

const minIncomeForDuplex = 60000;
const minCreditScoreForDuplex = 700;

const minIncomeForCondo = 45000;
const minCreditScoreForCondo = 680;

const minIncomeForCar = 30000;
const minCreditScoreForCar = 650;

function getLoanMessage(annualIncome, creditScore) {
  if(creditScore >= minCreditScoreForDuplex && annualIncome >= minIncomeForDuplex) {
    return "You qualify for a duplex, condo, and car loan."

// User Editable Region

  }
function getLoanMessage(annualIncome, creditScore) {
    if (
        annualIncome >= minIncomeForCondo &&
        creditScore >= minCreditScoreForCondo &&
        annualIncome >= minIncomeForCar &&
        creditScore >= minCreditScoreForCar
    ) {
        return "You qualify for a condo and car loan.";
    }
   return undefined; why it is showing error continously even though i have been doing this since 3 days 
}





}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36

Challenge Information:

Build a Loan Qualification Checker - Step 4

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

Please don’t create duplicate posts as it’s against the forum rules. I have merged your posts.

Please do not make topics and only provide the code without comment. That makes it harder for us to help when you do talk to us about how you’re stuck. Thanks