Race Day Project wont run

I am doing the race day project and very frustrated. My code keeps coming back as an error. But Ive compared it to the video and its the same as the video.

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

let early = true;

let age = 35;

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 (early && age < 18) {

console.log(`Race will begin at 11:00, your race number is: ${racenumber}.`);

}

else{

console.log('Please approach the registration desk, thanks!');

}

What have I done wrong?

Compare

let raceNumber

and

${racenumber}

Once you’ve studied both of these, take a look at the error message:

Uncaught ReferenceError: racenumber is not defined

Did you define racenumber?

No - you defined raceNumber. Capitalisation is key :slight_smile:

1 Like

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