Race Day: console.log turns out blank

Hey guys. When I press save nothing prints. Not an error, not a race number, nothing, it’s just blank.

I tried watching the video, but I can’t see what I’m missing.

Can any of you see what’s wrong? Thanks for any help.

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

const earlyRegister = true;

const age = 15;

if (earlyRegister && age > 18) {
  raceNumber += 1000;
}

if (earlyRegister && age > 18) {
  console.log(`Race will begin at 9:30 am. Your race number is ${raceNumber}.`);
}
else if (age < 18 && !earlyRegister) {
  console.log(`Race will begin at 11 am. Your race number is ${raceNumber}.`);

}
else if (age > 18) {
  console.log(`Race will begin at 12:30 am. Your race number is ${raceNumber}.`);
}

which would suggest none of your condition is true, which you could test by adding an else clause?

1 Like

Thank you, that helped. Also testing a different age didn’t hurt :upside_down_face:

good thinking :slight_smile: So all good now?

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