Race Day Project, Syntax Error

Hi Guys and Gals,

I’m currently about to finish the Race Day project on JavaScript:
[https://www.codecademy.com/paths/web-development/tracks/getting-started-with-javascript/modules/learn-javascript-control-flow/projects/race-day]

Here is my code for reference;

My issue is, whenever I get to the first else if line of code for not early and over 18, I get the following syntax error;
Error Race project

I’ve watched the walkthrough video to see where I’ve gone wrong, but still can’t find the issue.
Please help, I’m tearing my hair out trying to figure out why this error shows!! :crazy_face:

I got it :money_mouth_face: :money_mouth_face:

You used semicolon[; ] in almost three conditions after the parenthesis. If you put a semicolon[; ] thereafter the parenthesis it will not check the statement inside the body of if, else if and any other statement.

It should be in this way.

.....................

if(early && age>18)
    console.log(`Your race will start at 9:30am, please note your race number: ${racenumber}`);

else if(!early && age>18)
    console.log(`Your race will start at 11:00am, please note your race number: ${racenumber}`);

else if(age < 18)
    console.log(`Your race will start at 12:30pm, please note your race number: ${racenumber}`);

......................

and one thing if there is one statement inside the body, then it’s not necessary to use curly braces followed by the parenthesis. But, if you want then you can use it.

1 Like

Amazing, I didn’t even realise!! Thank you so much :raised_hands:

1 Like