Help with Race Day

let raceNumber = Math.floor(Math.random() * 1000);
let early = true;
let age = 23;

if(early && age > 18){
  raceNumber += 1000;
}
if(early && age > 18){
  console.log(`Race will begin at 9:30, your race number is: $(raceNumber)`);
}

else if(!early && age > 18){
  console.log(`Race will begin at 11:00, your race number is: $(raceNumber)`);
}
else if(age < 18){
   console.log(`Race will begin 12:30, your race number is: $(raceNumber)`);
}

Something is wrong I dont know what it is but when I run it instead of saying the race number (‘90, 87 etc’) it just puts: Race will begin at 9:30, your race number is: $(raceNumber)
cant figure out the problem though.

1 Like

to use template literal placeholders you have to use accolades:

const expression = 'template literals';
console.log(`using ${expression}`);
3 Likes

Didn’t even realize that lol, Alright thanks for the help.

1 Like