Https://www.codecademy.com/courses/introduction-to-javascript/projects/race-day

let registeredEarly = true;

let age = 25;

let raceNumber = Math.floor(Math.random() * 1000);

if (age > 18 && registeredEarly){

console.log(raceNumber += 1000);

}

if (age > 18 && registeredEarly){

console.log(You'll race at 9:30 am by ${raceNumber});

} else if (age > 18 && !registeredEarly){

console.log(You'll race at 11:00 am by ${raceNumber});

} else if (age < 18){

console.log(You'll race at 12:30 pm by ${raceNumber});

} else {

console.log(‘Check the registration desk!’)

}

Help me, please. In console I’ve ‘You’ll race at 9:30 am by 1544’ only. What should I edit?

Hi @bonusbonum2218908242 and welcome to the forum!
which output are you expecting? The condition age > 18 && registeredEarly is met.

This increases the race number by 1000:

And this:

if (age > 18 && registeredEarly){
console.log( `You'll race at 9:30 am by ${raceNumber}` );
}

logs the sentence you posted to the console.

Since this condition was met and the function was entered, the else statements are ignored.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.