Race Day Problem - Syntax Error Unexpected Token?

Hi Everyone,

I’m super new to coding and I’m working on the Race Day assignment.

I’ve only just started this one and I can’t figure out why I keep getting this unexpected token error at the first { for my If statement, I’ve tried spacing it out different ways and it keeps giving me the same error. I’ve looked at the walk through and through multiple examples on this forum and just can’t figure it out:

If(earlyRunner && age>18) {raceNumber += 1000};
SyntaxError: Unexpected token {
at createScript (vm.js:53:10)
at Object.runInThisContext (vm.js:95:10)
at Module._compile (module.js:543:28)…

Here is my code:

let raceNumber = Math.floor(Math.random() * 1000);
let earlyRunner = true; //boolean early runner
let age = 21; //assign a value to age

If (earlyRunner && age>18) {raceNumber += 1000};

Hello @course2663429110, welcome to the forums. The problem is with this:

It should be lower case (if) not uppercase (If).
Happy coding!

1 Like