Race Day - Project Question

I am stuck on the Race Day project, step #5. Here is my code so far that is giving me a huge error message when rendered:

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

let early = true;

let age = 46;

if(early && age > 18){

raceNumber += 1000;

}

if(early && age > 18){

console.log(You will race at 9:30 am and your race number is: ${raceNumber}.);

I have no idea what I am doing wrong. I even checked the solution video and I believe I have done exactly what he has done in the video. Is it giving me an error message because I shouldn´t render it until I complete all 9 steps??

You must select a tag to post in this category. Please find the tag relating to the section of the course you are on E.g. loops, learn-compatibility

When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!

If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer! :slight_smile:

Hey Benji how are you doing?

if(early && age > 18){

console.log( `You will race at 9:30 am and your race number is: ${raceNumber}.` );

You forgot to close your if statement! :wink:

I actually have the backticks in there at the beginning and at the end of the quote. Not sure why it wasn´t copied in my original post!

Do you mean in your previous post?
You can use the Create a Codebyte button too to paste code, it’s a very cool feature and avoids you the use of the backticks :wink:

I have absolutely no idea where to find that.

Oh, now I see it. Thanks!

1 Like

So did you solve your issue or are still having troubles?

Still having trouble, unfortunately. My code appears exactly the same as in the solution video, but it still gives me an error when I SAVE it and render it. Have no idea what´s wrong.

post the code and a screenshot and I’m going to scare the errors right away

I told you before, you gotta close that if condition. You opened the curly bracket but you didn’t close it!

Just close it with a bracket on Line 11?

Oh yes! But be sure to write a curly bracket.

Did you save your file?

Yes. And I´m still getting the errors.

Weird, try to refresh the page of the browser, if the code is saved you won’t lose it.

Refreshed, but still getting the errors.

Well the code you posted in your first post, once corrected with the final curly bracket, in the Codebyte works perfectly: