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
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.
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
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