Why did I have to leave my else} statement blank?

So, I was on step 9 which is the last step for the project I’m working on, link here: https://www.codecademy.com/courses/introduction-to-javascript/projects/race-day

The step states “Don’t forget about runners exactly 18 years old! Add an else statement that logs a statement to the console telling the runner to see the registration desk.

So, the code I did was:

else (runnerAge === runnerAge){

 console.log('Please go check with the registration desk for assistance.');


Isn’t the else statement pretty much saying “If runners age is 18” they will get the response in the console? When I submitted this, the console in the lesson returned back an error:

else (runnerAge === runnerAge) {
SyntaxError: Unexpected token {
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)

When I cleared the else statement, because the youtube video provided if you get stuck, the guy did that, the code after was:

  console.log('Please go check with the registration desk for assistance.');

And, I didn’t receive an error. How does the program know that I’m asking whether or not, the runner age is 18 if the else statement is blank?

Welcome to the forums! :tada:

If you want to add a condition to your else statement you need an else if.
Otherwise, else explicitly means to target whatever else happens that’s not outlined in your if condition.

SyntaxError: Unexpected token { refers to be the curly bracket being unexpected because it expects the if part of the clause. It’s specifically noting that there’s something wrong with the syntax.

For more info: